1

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.

Putnik
  • 2,217
  • 4
  • 27
  • 43

1 Answers1

3

Sounds like you need your redis_simple.sh (and redis.sh) to be moved out of /etc/collectd.d, so collectd doesn't try parsing these as configuration files

Or: look at your collectd.conf, there may be something like Include "/etc/collectd.d/*" that you may replace with Include "/etc/collectd.d/*.conf"

SYN
  • 1,751
  • 9
  • 14