3

I have an issue with custom script using exec plugin. From shell the script works well and nothing useful in /var/log/collectd.log.

LoadPlugin logfile
<Plugin logfile>
        LogLevel info
        File "/var/log/collectd.log"
        Timestamp true
        PrintSeverity true
</Plugin>

How can I debug/troubleshoot it? In the doc I found an example

-> | PUTVAL "testhost/interface/if_octets-test0" interval=10 1179574444:123:456
<- | 0 Success

But how can I run it, how can I pass my PUTVAL to collectd? The collectd does not listen any port (all the other plugins work well and send data to graphite).

Just to be clear: the problem is not to see the generated string but to make sure the particular string will be accepted.

Thank you.

p.s. the particular issue: the script returns dozens of values but one of them only get to graphite.

Putnik
  • 2,507
  • 6
  • 29
  • 43

2 Answers2

0

Your custom script should use the text protocol you mentions by wrting commands to stdout. You can find a very simple example in the docs : https://collectd.org/wiki/index.php/Plugin:Exec

echo "PUTVAL \"$HOSTNAME/exec-magic/gauge-magic_level\" interval=$INTERVAL N:$VALUE"

Basically, your script should only write PUTVAL commands to stdout (and nothing else) to submit values.

MCE35
  • 33
0

Stopping the service, and manually running check_capability -f displays errors that do not get printed to the log file.