Commit Graph

2 Commits

Author SHA1 Message Date
Lukasz Jagiello e3e6fa4f1d
Sudo support for ceph/varnish plugin
In many default installations ceph and varnish binaries require root
permissions or specific user permissions to actually gather metrics.

Although it's possible to instrumented system configuration to either
run telegraf with root privileges or share the same user/permissions as
measured software it's not a default setup.

In my opinion ability to run binary with `sudo` makes entire setup
simpler without additional interaction.

My changes allow to use configuration like:
```
binary = "/usr/bin/sudo /usr/bin/varnishstat"
ceph_binary = "/usr/bin/sudo /usr/bin/ceph"
```

With a proper sudo configuration it will simplify amount of changes
needed to collect metrics.

I've also changed type of varnish metrics. It was `int` but in varnish source
code we can find all metrics are actually uint64
(https://github.com/varnishcache/varnish-cache/blob/master/include/tbl/vsc_f_main.h)

I hit that issue with some metrics:
```
~# varnishstat -1 | grep -i MAIN.n_objectcore
MAIN.n_objectcore      18446744073709550877          .   objectcore structs made
```
2016-05-25 23:49:42 +00:00
robinpercy-xm 69dfe63809 Implemented ceph collector (#1172)
- records metrics from the output of mon and osd socket perf
  dumps.
2016-05-18 15:48:44 +01:00