Friday, 1 October 2010

Nagios - setting up a new service (Check_Printer)

(When testing a plugin - use the full path to the plugin)

1. Download & unTar
Download and copy the extracted new plugin to /usr/local/nagios/libexec/

2. Setup new service in commands.cfg

#Monitor Printer via SNMP

define command{
command_name check_printer
command_line check_printer.sh
}

3. Verify Nagios Configuration
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

4. Setup Service
vi /usr/local/nagios/etc/objects/
define service{
use generic-service ; Inherit values from a template
host_name BHLHROPSCOLOUR,BHMANOPS,BHLHRACC,BHLHROPSCOLOUR,BHLHROPS,ScannerFaxCopier
service_description Printer Status ; The service description
check_command check_printer ; The command used to monitor the service
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
5. Restart Nagios
/etc/init.d/nagios restart

try accessing using snmpwalk to see if you can access the device
snmpwalk -c public -v 1 200.200.200.123

No comments:

Post a Comment

Blog Archive