Telegraf v1.0.1 (git: master 26acdc9231efde105510fe5df3da7519bc4f42f7)
Telegraf service is running successfully sudo service telegraf status
shows telegraf is running [OK]
.
I'm using Wavefront's SaaS based monitoring solution for showing Telegraf data or setting up various other things (alerts, dashboards).. it works.
Overview: When you install Telegraf, it creates its main config file at /etc/telegraf/telegraf.conf and a user can put other configurations under /etc/telegraf/telegraf.d/*.conf (files).
I have /etc/telegraf/telegraf.d/extra-inputs-plugins.conf and in this file, I have the following contents (as you see, it's using filestat inputs plugin) and the following configuration works:
## Telegraf filestat plugin
[[inputs.filestat]]
files = ["/var/run/*/*.pid","/var/run/*.pid"]
On some database servers, I have installed EnhanceIO
(for more info look here: https://github.com/stec-inc/EnhanceIO
Once EnhanceIO is installed, you'll get a folder structure like this:
ubuntu@MyTestCluster-1a-db2-i-0cf6u98b136b211ba:~$ find /proc/enhanceio
/proc/enhanceio
/proc/enhanceio/data_cache
/proc/enhanceio/data_cache/config
/proc/enhanceio/data_cache/io_hist
/proc/enhanceio/data_cache/errors
/proc/enhanceio/data_cache/stats
/proc/enhanceio/version
To configure Telegraf's filestat plugin to catch/look for /proc/enhanceio/data_cache/config
file, I can add that or /proc/enhanceio/data_cache/*
in my configuration (but doing this way, the solution won't be scalable i.e. what if I want telegraf to pick all files under /proc folder.
The plugin doc / comments section says:
## These accept standard unix glob matching rules, but with the addition of
## ** as a "super asterisk".
So, I tried the following configuration to look for every file (recursively):
[[inputs.filestat]]
files = ["/var/run/*/*.pid","/var/run/*.pid","/proc/*"]
The above resulted in the following output when I run: $ telegraf --config-directory=/etc/telegraf -test|grep filestat|grep -v '/var/run/'|grep enhance
(actually /proc/enhanceio is a folder).
> filestat,host=MyTestCluster-1a-db2-i-0cf6u98b136b211ba,file=/proc/enhanceio exists=1i,size_bytes=0i 1485548956000000000
Then, I tried using the **
approach but I got NOTHING?
[[inputs.filestat]]
files = ["/var/run/*/*.pid","/var/run/*.pid","/proc/**"]
$ telegraf --config-directory=/etc/telegraf -test|grep filestat|grep -v '/var/run/'|grep enhance
2017/01/27 20:31:38 I! Using config file: /etc/telegraf/telegraf.conf
$
I tried, almost all glob patterns (like: /proc/enhanceio/*/*
, /proc/enhanceio/*/**
, /proc/enhanceio/**/*
or /proc/enhanceio/**/**
) but it just didn't catch any files under /proc/enhanceio tree.
Why filestat plugin's SUPER GLOB pattern didn't work at all when I tried the above patterns?
How can I make the filestat plugin catch all files under /proc tree?
PS: I know giving /proc/enhanceio/data_cache/*
will work if I want to catch config
file under that directory (at just that level).