Nagios 4 check_snmp_printer issues

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Nagios 4 check_snmp_printer issues

Post 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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios 4 check_snmp_printer issues

Post by jdalrymple »

Can you show us your command definition for check_snmp_printer?
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Nagios 4 check_snmp_printer issues

Post 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$
        }

User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios 4 check_snmp_printer issues

Post 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$
Be sure to check out our Knowledgebase for helpful articles and solutions!
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Nagios 4 check_snmp_printer issues

Post by nathanplatt »

That was it! Spent hours on this. Thanks again for the help
Locked