Trying to get this plugin to work http://exchange.nagios.org/index.php?op ... &Itemid=74
/etc/nagios/objects/commands.cfg
Code: Select all
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$
}
Code: Select all
command[check_snmp_printer]=/usr/lib64/nagios/plugins/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$
Code: Select all
define service{
use generic-service
host_name Test-Printer
service_description Toner Supply
check_command check_snmp_printer!public!"CONSUM Toners"!20!10
}
#./check_snmp_printer -H 192.168.4.50 -C public -x "CONSUM ALL" -w 20 -c 10
Black Toner [K] Cartridge;SN1220AA80E00004A0 is at 99% - OK! Yellow Toner [Y] Cartridge;SN04156480E0000478 is at 89% - OK! Magenta Toner [M] Cartridge;SN11338080E0000479 is at 83% - OK! Cyan Toner [C] Cartridge;SN0F2DD980E000047A is at 82% - OK! Waste Toner Container is OK! Black Drum Cartridge is at 93% - OK! Yellow Drum Cartridge is at 72% - OK! Magenta Drum Cartridge is at 71% - OK! Cyan Drum Cartridge is at 72% - OK! | Black Toner [K] Cartridge;SN1220AA80E00004A0=99;20;10; Yellow Toner [Y] Cartridge;SN04156480E0000478=89;20;10; Magenta Toner [M] Cartridge;SN11338080E0000479=83;20;10; Cyan Toner [C] Cartridge;SN0F2DD980E000047A=82;20;10; Waste Toner Container=-3;20;10; Black Drum Cartridge=93;20;10; Yellow Drum Cartridge=72;20;10; Magenta Drum Cartridge=71;20;10; Cyan Drum Cartridge=72;20;10;
However it doesn't work through nagios
I get this (even when I use CONSUM TEST instead of CONSUM ALL)
UNKNOWN - OID not found! Your printer may not support checking this consumable. Use the CONSUM TEST option to determine which consumables may be monitored.
and I also got this error initially
No SNMP response from 192.168.x.x! Make sure host is up and SNMP is configured properly.
Once again works fine manually when using check_snmp_printer in a shell
EDIT: It's been a few hours and my replies are still not approved.
Thanks for your reply
I checked to make sure I can run the command as nagios user and works fine, nagios is the owner of the check_snmp_printer script, I have removed the extra service in /etc/nagios/command_plugins.cfg