Monitoring collectd data with Nagios

This is possible with the supplied collectd-nagios program. This program must run on the same machine as collectd.

First, enable the unixsock plugin by adding these to the collectd.conf:

LoadPlugin unixsock
<Plugin unixsock>
    SocketFile "/tmp/collectd.sock"
    SocketGroup "nagios"
    SocketPerms "0770"
 </Plugin>

Suppose you want to monitor the 15 min load, the check command will be:

/usr/bin/collectd-nagios -s /tmp/collectd.sock -H localhost -n "load/load" -d longterm -w <warn_load> -c <crit_load>

Sample output:

# /usr/bin/collectd-nagios -s /tmp/collectd.sock -H localhost -n "load/load" -d longterm -w 3 -c 4
OKAY: 0 critical, 0 warning, 1 okay | longterm=0.1;;;;

To monitor the memory usage, the check command will be:

/usr/bin/collectd-nagios -s /tmp/collectd.sock -H localhost -n "memory/memory-used" -w <bytes> -c <bytes>

Note the -H and -n argument match the directory structure and rrd file name:

# tree /var/lib/collectd/localhost/load/
/var/lib/collectd/localhost/load/
`-- load.rrd

# tree /var/lib/collectd/localhost/memory/
/var/lib/collectd/localhost/memory/
|-- memory-buffered.rrd
|-- memory-cached.rrd
|-- memory-free.rrd
`-- memory-used.rrd

Lastly, define the check commands as usual in nagios config.

collectd/working_with_nagios.txt · Last modified: 2010-03-16 20:09 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0