Page 1 of 1

SNMP Printer monitoring

Posted: Thu Mar 24, 2011 9:18 am
by PepijnBosgoed
Hi guys,

I am using Nagios XI (2009R1.3G) to monitor some of our servers and now I want to monitor a printer as well. I have tried it with the printer wizard, but that didn't work for me. Now I am trying it through SNMP. With a SNMP walker I found the OID's I need.

The printer I want to monitor is an HP OfficeJet 8500. The required OID's for monitoring the status of the ink are:

black: .1.3.6.1.2.1.43.11.1.1.9.1.1
yellow: .1.3.6.1.2.1.43.11.1.1.9.1.2
magenta: .1.3.6.1.2.1.43.11.1.1.9.1.3
cyan: .1.3.6.1.2.1.43.11.1.1.9.1.4

So far, so good. I can monitor the ink levels and when I compare it with the web interface from the printer it seems to be right.

However, when I set the warning on 35% and the critical on 25% it begins to shout when the cartridge is for 38% full. When I set only a warning on 40% it says the cartridge is ok. Apparently it thinks that it has to deal with a value from 0 - 100 in stead of 100 - 0.

Do you guys have any idea how to convert this? The command which is used is as follow:

check_xi_service_snmp! -o .1.3.6.1.2.1.43.11.1.1.9.1.3 -C public -P 1 -w 35 -c 25

I hope you guys can help me out here :)

Thanks in advance!

Re: SNMP Printer monitoring

Posted: Thu Mar 24, 2011 1:33 pm
by tonyyarusso
From check_snmp -h:
-w, --warning=INTEGER_RANGE(s)
Range(s) which will not result in a WARNING status
-c, --critical=INTEGER_RANGE(s)
Range(s) which will not result in a CRITICAL status

- Ranges are inclusive and are indicated with colons. When specified as
'min:max' a STATE_OK will be returned if the result is within the indicated
range or is equal to the upper or lower bound. A non-OK state will be
returned if the result is outside the specified range.
- If specified in the order 'max:min' a non-OK state will be returned if the
result is within the (inclusive) range.
See also http://nagiosplug.sourceforge.net/devel ... HOLDFORMAT.

Short answer: If given just an integer, that is interpreted as alerting when greater than that integer or less than zero, which is not what you want. What you need is something like this:

Code: Select all

check_xi_service_snmp! -o .1.3.6.1.2.1.43.11.1.1.9.1.3 -C public -P 1 -w 35: -c 25: