Page 1 of 1

Nagios 4 check_snmp_printer issues

Posted: Tue Jul 21, 2015 4:06 am
by nathanplatt
Hi Everyone,

I'm trying to monitor printers on our network and I'm having mixed results. When I use;

nagios@nagios:/usr/local/nagios/libexec$ ./check_snmp_printer -H 192.168.1.236 -C public -x "CONSUM Cyan" -w 20 -c 10
Cyan Cartridge HP CC531A is at 22% - OK! | Cyan Cartridge HP CC531A=22;20;10;

This works however if I try this from Nagios I get the following error;

Toner Supply Cyan

OK 07-21-2015 10:00:49 0d 0h 5m 33s 1/3 UNKNOWN - OID not found! Your printer may not support checking this consumable. Use the CONSUM TEST option to determine which consumables may be monitored.

Code: Select all

define service{
        use                     generic-service
        host_name               Software
        service_description     Toner Supply Black
        check_command           check_snmp_printer!public!"CONSUM Black"!20!10
        }

define service{
        use                     generic-service
        host_name               Software
        service_description     Toner Supply Cyan
        check_command           check_snmp_printer!public!"CONSUM Cyan"!20!10
        }

define service{
        use                     generic-service
        host_name               Software
        service_description     Toner Supply Magenta
        check_command           check_snmp_printer!public!"CONSUM Magenta"!20!10
        }

define service{
        use                     generic-service
        host_name               Software
        service_description     Toner Supply Yellow
        check_command           check_snmp_printer!public!"CONSUM Yellow"!20!10
        }
Have I missed something?

Nathan

Re: Nagios 4 check_snmp_printer issues

Posted: Tue Jul 21, 2015 9:54 am
by jdalrymple
Can you show us your command definition for check_snmp_printer?

Re: Nagios 4 check_snmp_printer issues

Posted: Tue Jul 21, 2015 10:38 am
by nathanplatt

Code: Select all

# 'check_snmp_printer' command definition
define command{
        command_name check_snmp_printer
        command_line /usr/local/nagios/libexec/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$
        }


Re: Nagios 4 check_snmp_printer issues

Posted: Tue Jul 21, 2015 11:15 am
by tgriep
The ARG2 is missing the second $, change it to the following and see if that resolves it for you.

Code: Select all

command_line /usr/local/nagios/libexec/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$

Re: Nagios 4 check_snmp_printer issues

Posted: Tue Jul 21, 2015 11:50 am
by nathanplatt
That was it! Spent hours on this. Thanks again for the help