check_snmp_printer
Posted: Thu Oct 29, 2015 10:41 pm
Hi everyone,
I'm having issues with the check_snmp_printer which i have downloaded from the nagios exchange.
Basically, downloaded the plugin and loaded in my ubuntu system /usr/lib/nagios/plugins
Run it manually and it works fine.
./check_snmp_printer -H 192.168.1.38 -C public -x "CONSUM ALL" -w 20 -c 10
Black Toner [K] Cartridge;SN071ACE80E0000495 is at 84% - OK! Yellow Toner [Y] Cartridge;SN122B4E80E00004AC is at 100% - OK! Magenta Toner [M] Cartridge;SN0139A980E00004EA is at 73% - OK! Cyan Toner [C] Cartridge;SN140FE180E0000498 is at 52% - OK! Waste Toner Container is OK! Black Drum Cartridge is at 77% - OK! Yellow Drum Cartridge is at 26% - OK! Magenta Drum Cartridge is at 28% - OK! Cyan Drum Cartridge is at 28% - OK! | Black Toner [K] Cartridge;SN071ACE80E0000495=84;20;10; Yellow Toner [Y] Cartridge;SN122B4E80E00004AC=100;20;10; Magenta Toner [M] Cartridge;SN0139A980E00004EA=73;20;10; Cyan Toner [C] Cartridge;SN140FE180E0000498=52;20;10; Waste Toner Container=-3;20;10; Black Drum Cartridge=77;20;10; Yellow Drum Cartridge=26;20;10; Magenta Drum Cartridge=28;20;10; Cyan Drum Cartridge=28;20;10;
i have put my command definition in /etc/nagios-plugins/config
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c
}
Run the command in /etc/nagios3/conf.d
# Check PRINTER - Consumables
define service {
use generic-service ; Inherit values from a template
host_name printer_groupmain
service_description Printer Model
check_command check_printer!public!"CONSUM Magenta"!20!10
}
and it comes up with the message
Error: Could not find any host matching 'printer_groupmain' (config file '/etc/nagios3/conf.d/printers-service.cfg', starting on line 46)
Error: Could not expand hostgroups and/or hosts specified in service (config file '/etc/nagios3/conf.d/printers-service.cfg', starting on line 46)
Error processing object config files!
Please help. Thanks.

I'm having issues with the check_snmp_printer which i have downloaded from the nagios exchange.
Basically, downloaded the plugin and loaded in my ubuntu system /usr/lib/nagios/plugins
Run it manually and it works fine.
./check_snmp_printer -H 192.168.1.38 -C public -x "CONSUM ALL" -w 20 -c 10
Black Toner [K] Cartridge;SN071ACE80E0000495 is at 84% - OK! Yellow Toner [Y] Cartridge;SN122B4E80E00004AC is at 100% - OK! Magenta Toner [M] Cartridge;SN0139A980E00004EA is at 73% - OK! Cyan Toner [C] Cartridge;SN140FE180E0000498 is at 52% - OK! Waste Toner Container is OK! Black Drum Cartridge is at 77% - OK! Yellow Drum Cartridge is at 26% - OK! Magenta Drum Cartridge is at 28% - OK! Cyan Drum Cartridge is at 28% - OK! | Black Toner [K] Cartridge;SN071ACE80E0000495=84;20;10; Yellow Toner [Y] Cartridge;SN122B4E80E00004AC=100;20;10; Magenta Toner [M] Cartridge;SN0139A980E00004EA=73;20;10; Cyan Toner [C] Cartridge;SN140FE180E0000498=52;20;10; Waste Toner Container=-3;20;10; Black Drum Cartridge=77;20;10; Yellow Drum Cartridge=26;20;10; Magenta Drum Cartridge=28;20;10; Cyan Drum Cartridge=28;20;10;
i have put my command definition in /etc/nagios-plugins/config
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c
}
Run the command in /etc/nagios3/conf.d
# Check PRINTER - Consumables
define service {
use generic-service ; Inherit values from a template
host_name printer_groupmain
service_description Printer Model
check_command check_printer!public!"CONSUM Magenta"!20!10
}
and it comes up with the message
Error: Could not find any host matching 'printer_groupmain' (config file '/etc/nagios3/conf.d/printers-service.cfg', starting on line 46)
Error: Could not expand hostgroups and/or hosts specified in service (config file '/etc/nagios3/conf.d/printers-service.cfg', starting on line 46)
Error processing object config files!
Please help. Thanks.