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.

2 Answers 2

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.

4
  • 1
    It does write. Where can I send the output to to make sure it is accepted without errors? Commented Dec 7, 2016 at 17:33
  • Using the exec plugin, there is no way to ensure values are processed by collectd, but I'm using it for quite a few years now without problem. Commented Dec 8, 2016 at 16:51
  • If you want to debug your script, you can write some logs using the logger command or any other means (writing to a temporary file, ...) Commented Dec 8, 2016 at 16:52
  • 1
    The problem is not to see the generated string but to make sure the particular string will be accepted. Commented Dec 8, 2016 at 20:17
0

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

1
  • I'm on a Debian 12 system, and I can't find check_capability. Commented Aug 12 at 17:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.