how to monitor Xerox Phaser 7400DN printer with icinga

With this useful plugin you can monitor easily your network printer.Download and move it to directory with the other plugins.In my case the directory is /usr/lib/nagios/plugins/.Make sure the snmp is configured on the printer side.Now, lets’ test the plugin root@icinga:/usr/lib/nagios/plugins# ./check_snmp_printer -H 192.168.0.75 -x "MODEL"
"Xerox Phaser 7400DN;PS4.2.0,Net25.72.10.07,Eng0.11.2,OS6.26", Serial # XXXXXXXXX

Icinga-Printer
Now, we have to define host, check_command and services for our new object.
root@icinga:/usr/local/icinga/etc# vim objects/Default_collector/hosts.cfg
define host {
host_name Printer
address 192.168.0.75
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
notification_options d,n
check_command check-host-alive
check_period 24x7
notification_period 24x7
contact_groups +admins
}

root@icinga:/usr/local/icinga/etc# vim objects/global/checkcommands.cfg

define command{
command_name check_consumables
command_line $USER1$/check_snmp_printer -H $ARG1$ -C public -x $ARG2$ -w 30 -c 15
}

define command{
command_name check_paper
command_line $USER1$/check_snmp_printer -H $ARG1$ -C public -x $ARG2$
}

root@icinga:/usr/local/icinga/etc# vim objects/Default_collector/services.cfg


define service{
use generic-service
host_name Printer
service_description Tray1 Paper Status
check_command check_paper!$HOSTADDRESS$!"TRAY 1"
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}
define service{
use generic-service
host_name Printer
service_description Tray2 Paper Status
check_command check_paper!$HOSTADDRESS$!"TRAY 2"
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}

define service{
use generic-service
host_name Printer
service_description Black Toner Status
check_command check_consumables!$HOSTADDRESS$!”CONSUM Black Toner”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}
define service{
use generic-service
host_name Printer
service_description Cyan Toner Status
check_command check_consumables!$HOSTADDRESS$!”CONSUM Cyan Toner”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}

define service{
use generic-service
host_name Printer
service_description Magenta Toner Status
check_command check_consumables!$HOSTADDRESS$!”CONSUM Magenta Toner”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}
define service{
use generic-service
host_name Printer
service_description Yellow Toner Status
check_command check_consumables!$HOSTADDRESS$!”CONSUM Yellow Toner”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}

define service{
use generic-service
host_name Printer
service_description Fuser Status
check_command check_consumables!$HOSTADDRESS$!”CONSUM Fuser”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}
define service{
use generic-service
host_name Printer
service_description Waste Status
check_command check_consumables!$HOSTADDRESS$!”CONSUM Waste”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}

define service{
use generic-service
host_name Printer
service_description Cyan Imaging
check_command check_consumables!$HOSTADDRESS$!”CONSUM Cyan Imaging”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}
define service{
use generic-service
host_name Printer
service_description Magenta Imaging
check_command check_consumables!$HOSTADDRESS$!”CONSUM Magenta Imaging”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}

define service{
use generic-service
host_name Printer
service_description Yellow Imaging
check_command check_consumables!$HOSTADDRESS$!”CONSUM Yellow Imaging”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}
define service{
use generic-service
host_name Printer
service_description Black Imaging
check_command check_consumables!$HOSTADDRESS$!”CONSUM Black Imaging”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}

define service{
use generic-service
host_name Printer
service_description Transfer Belt
check_command check_consumables!$HOSTADDRESS$!”CONSUM Transfer Belt”
check_period 24×7
notification_period 24×7
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
event_handler_enabled 0
contact_groups +admins
}

root@icinga:/usr/lib/nagios/plugins# service icinga reload
Running configuration check...OK
Reloading icinga configuration...done

Leave a Reply

Your email address will not be published. Required fields are marked *