Thursday, April 9, 2009

Zenoss monitor customized application via NRPE

Zenoss doesn't have native NRPE plugin like OpenNMS, But Zenoss has the ability to run customized application though the ZenCommand process, ZenCommand can run any command locally and remotely by using a native SSH transport. When run, Zenoss tracks the return code( 0 =success, !0= fail)
Zenoss can monitor customized applications by various methods e.g SSH/NRPE/SNMP, this note demonstrates NRPE method

#==Install NRPE

Follow instructions here, until you can run remote command via NRPE
sudo -u nagios /usr/lib/nagios/plugins/check_nrpe -H remote-host -c check_test

#==Create template under Devices/Server to use the script
(You can create template under any scope e.g Devices/Server/linux)
Classes->Devices->Server(sub-Devices)Templates->Add Template (add template is hidden drop down menu brought up by clicking the small triangle button)
New data Source ( ID: userdefined–NRPE TYPE: command)

use ssh :false
Event Class:/cmd/fail
Command Template: /usr/lib/nagios/plugins/check_nrpe -H ${here/manageIp} -c check_test

#==Bind the template to your Device
Device List->yourdevice->Open->
Click the small triangle button->More->Template
Click the small triangle button->Bind Templates->add new template to selection (You can select multiple templates)
/opt/zenoss/zenoss/bin/zencommand run -d -v10
The output show you zencommand found the new script and executed it.
Back to GUI, the alarm should appear in event log of the device.

1 comment:

  1. Good one thanks. I saw more and more the adv of nagios compared to zenoss.