[collectd] collectd exec and perl
Mariusz Gronczewski
xani666 at gmail.com
Thu Oct 28 12:07:03 CEST 2010
Hi,
if u use "interval" you have to use actual time instead of "N:" (at
least it didn't want to work otherwise for me)
If it still dont work, turn off input buffering
$| = 1;
Regards
Mariusz
2010/10/28 Suraj <suraj at sunson.in>:
> Hi,
> I'm facing the following issue with executing an exec plugin that is a perl
> script. The script is quite bare bones and just prints out a PUTVAL. An
> identical shell script ends up creating the RRD but the same with a perl
> script does not work:
> To illustrate the problem, here is some setup information:
> types.db:
> ------------
> svc failures:COUNTER:0:9223372036854775807
>
> The following setup does not work when using a perl exec plugin:
> collectd.conf:
> -------------------
> LoadPlugin exec
> <Plugin exec>
> Exec "foo" "/usr/local/bin/collectd_test.pl"
> </Plugin>
> collectd_test.pl:
> ------------------------------------------
> #! /usr/bin/perl
> while (1) {
> print 'PUTVAL sometest/exec-magicpl/svc-service interval=60 N:40' .
> "\n";
> sleep 60
> }
> Whereas, the following works when using a shell script:
> collectd.conf:
> -------------------
> LoadPlugin exec
> <Plugin exec>
> Exec "foo" "/usr/local/bin/collectd_test.sh"
> </Plugin>
> collectd_test.sh
> -----------------------
> #! /bin/bash
> while [ true ]; do
> echo 'PUTVAL sometest/exec-magicshell/svc-service interval=60
> N:40'
> sleep 60
> done
> In the shell based setup, when collectd -C /etc/collectd/collectd.conf -f is
> run directly, I can see the "0 Success" message (I presume from the rrdtool
> plugin or perhaps the plain-text-protocol-interpreter?). Whereas, with the
> perl based plugin, the rrd does not get created.
> The log does not have anything though the loglevel is in debug mode.
> What am I doing wrong here and how can I get perl based plugins to work?
> thanks,
> -Suraj
>
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/listinfo/collectd
>
>
More information about the collectd
mailing list