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.