Using Nagios plugins with OpenNMS
OpenNMS can use Nagios plugins.
Setup NRPE
- On the machine to be monitored install the following packages:
- nrpe
- nagios-plugins-nrpe
- nagios-plugins
- Plugins go in /usr/lib/nagios/plugins
- On the monitoring machine install nagios-plugins-nrpe (just for testing).
- Start nrpe on the target machine (make sure you open port 5666 for your monitoring server):
# service nrpe start
- On your monitoring server, check you can connect (this should return the NRPE version):
$ /usr/lib/nagios/plugins/check_nrpe -n -H example.com -c _NRPE_CHECK
Setup OpenNMS
- Check in /opt/opennms/etc/examples for poller-configuration.xml and capsd-configuration.xml
- Copy the NRPE examples to your live config files and restart OpenNMS
SSL
Unfortunately OpenNMS can't talk SSL to NRPE so we need to modify /etc/init.d/nrpe on the target machine to use the -n switch:
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting nrpe: "
daemon $NrpeBin -c $NrpeCfg -d -n
echo
touch $LockFile
;;
Obviously you will want to restrict who can connect to your nrpe daemon using firewall rules.
