Trying to use exec plugin with collectd:
/etc/collectd.conf
:
...
LoadPlugin exec
...
<Plugin exec>
Exec "nobody:nobody" "/etc/collectd.d/redis_simple.sh"
</Plugin>
I've simplified /etc/collectd.d/redis_simple.sh
to this:
#!/bin/bash
while sleep 10
do
echo "PUTVAL nfs/redis-6379/memcached_items-db0 interval=10 N:3043"
done
The error:
# /etc/init.d/collectd restart
Stopping collectd: [ OK ]
Starting collectd: Parse error in file `/etc/collectd.d/redis.sh', line 1308 near `<newline>': syntax error, unexpected EOL
yyparse returned error #1
configfile: Cannot read file `/etc/collectd.d/redis.sh'.
Parse error in file `/etc/collectd.d/redis_simple.sh', line 1329 near `<newline>': syntax error, unexpected EOL
yyparse returned error #1
configfile: Cannot read file `/etc/collectd.d/redis_simple.sh'.
= [ OK ]
[ OK ]
There definitely is the new line at the end of both files. No windows EOLs. Nothing in logs. No line 1329 in /etc/collectd.d/redis_simple.sh.
Any help would be appreciated.
Sounds like you need your
redis_simple.sh
(andredis.sh
) to be moved out of/etc/collectd.d
, so collectd doesn't try parsing these as configuration filesOr: look at your
collectd.conf
, there may be something likeInclude "/etc/collectd.d/*"
that you may replace withInclude "/etc/collectd.d/*.conf
"