check_hpjd gripes. [SOLUTION]

Stein Bjørndal stein at proact.no
Fri Oct 21 13:16:41 CEST 2005


Since no brilliant ideas were forthcoming from the list I started digging a
bit on my own and came up with the following solution;

I could not find any options too feed to the check_hpjd plugin, so I started
looking into the check_snmp instead. Using Net-SNMP I did a snmpwalk on the
printer:

	snmpwalk -0s -c public -v 1 <ipaddress>

then started looking for the status string (displayed in the LCD display on
the printer). I found this to be mib-2.43.17.6.1.5.1.1 (this being a HP
Laserjet Color 4000dn).

I could also use:

	snmpget -c public -v 1 <ipaddress> mib-2.43.17.6.1.5.1.1 

to get just what I was looking for. I moved on to test this with the
check_snmp plugin and ended up the following syntax:

	check_snmp -H <ipaddress> --o mib-2.43.16.5.1.2.1.1 -r \
		"(Klar)|(Behandler)|(50 6F 77 65 72 73 61 76 65 20 70 D4)"

The -r option is indicating what regular expressions in the returned string
that should result in an OK status. The words here is in Norwegian and is
the national variants of "Ready" and "Processing". The HEX string seems to
be returned whenever the printer is in power save mode.

I then added the check to Nagios, adding the following definitions to the
configuration files:

checkcommands.cfg: 

	define command {
		command_name                   check_snmp_printer
		command_line                   $USER1$/check_snmp -H \
			$HOSTADDRESS$ -l STATUS -o $ARG1$ -r $ARG2$
	}

services.cfg:

	define service {
		name                           hp-printerstatus
		active_checks_enabled          1
		passive_checks_enabled         1
		parallelize_check              1      
		obsess_over_service            1      
		check_freshness                0      
		notifications_enabled          1      
		event_handler_enabled          1      
		flap_detection_enabled         1      
		process_perf_data              1      
		retain_status_information      1      
		retain_nonstatus_information   1      
		register                       0      
		service_description            DISPLAY
		is_volatile                    0
		check_command                  check_snmp_printer! \
			mib-2.43.16.5.1.2.1.1!"(Behandler)|(Klar)| \
			(50 6F 77 65 72 73 61 76 65 20 70 D4)"
		max_check_attempts             3
		normal_check_interval          10
		retry_check_interval           5
		check_period                   24x7
		notification_interval          120
		notification_period            workhours
		notification_options           w,u,c,r
	}

	define service {
		use                           hp-printerstatus
		host_name                     <hostname>
		contact_groups                printer-admins
	}

It works fine so far after rudimentary testing, but the real test will be
whenever something goes poo. 

Now, on to the next printer ...

Regards,
Stein

-----Original Message-----
From: Stein Bjørndal 
Sent: 17. oktober 2005 13:36
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] check_hpjd gripes.

Hi all,

We've been using Nagios for monitoring our network for quite some time and
also some time back started using check_hpjd for monitoring printers. That
works just fine, but as it stands now the printer may well be out of service
without an alarm being raised. That is mostly due to exhausted supplies
(toner or fuser kit). The status string reports the condition just fine,
it's just that status is still OK so nobody is made aware of the situation.

As an added complication, the strings reported here are not in English
(national language set on printer). So ideally I'd like a set of strings
that will set the status of the check to WARNING (aka "TONER LOW") and
another set of strings that will raise an alarm (aka "REPLACE FUSER KIT"). 

Raising an alarm when supplies is running low would be useful to avoid
service interuption while not having to stock supplies since we could order
new when a warning is raised.

It would be interesting to hear how others are handling this, I'm hazarding
a guess that this must have been discussed before, but were unable to find
anything relevant in the list archives.

Regards,
Stein


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list