Configuring scollector to get different frequences for different collectors

214 Views Asked by At

I'm working on scollector and I want to have specific frequencies for different collector.

For example:

  • get info from disk usage every 5 minutes
  • info from memory every minute
  • iostat every 30 seconds
  • and so on...

Here is a part of the conf.toml I made:

FullHost = true
Freq = 60
DisableSelf = true

[[iostat]]
  Filter = "iostat"
  Freq = 30

[[memory]]
  Filter = "memory"
  Freq = 60

But I get some error

./scollector -conf="perso.toml" -p
2016/04/19 14:40:45 fatal: main.go:297: extra keys in perso.toml: [iostat iostat.Freq memory memory.Freq]

It seems that I cannot multiply the frequencies.

What should I do to get what I want?

Thank you all

3

There are 3 best solutions below

0
Vitor On

According to scollector documentation, Freq is a global setting, so it's not possible to set different frequencies for each collector. The exception is for external collectors, which may be put in a folder named after the desired frequency (in seconds).

0
Dima Medvedev On

Freq is indeed global setting and interval is usually set to it. Although some collectors override interval to different values e.g. elasticsearch-indices runs every 15 minutes because there's a lot of data to pull.

To change it either

  • (best) hack scollector code to read and pass freq parameter to every collector
  • (second best) file a github issue
  • (last resort) you can just change intervals scollector code in specific collectors and recompile scollector
0
Node One On

Well, we might found something. We create differents folders representing several Freq (0, 30, 60, 120...) and in each folders, we write external collectors we need.

'/etc/collectors/0',
'/etc/collectors/15',
'/etc/collectors/30',
'/etc/collectors/60',
'/etc/collectors/120',
'/etc/collectors/300',
'/etc/collectors/600'

In the conf.toml:

ColDir = "/etc/scollector/collectors"

If we want the internal collectors, we have to rewrite them :(