Printer Checks

Printer Checks

Printer checks allow you to query the status of printers and their supplies.

 

Nagios Plugins

In you have a HP printer with a Jet Direct card then Nagios Plugins includes a check_hpjd plugin that can provide statistics on the printer.

Command:

./check_hpjd -H 10.25.21.1 -C public -p 161

Output:

Toner Low ("Ready")

 

Alternatively check the SNMP section below for other methods of monitoring printers via SNMP.

NCPA

NPCA does not include a printers module.

An alternative method is to query a performance counter, for example:

\Print Queue(FX DocuPrint M255 z PCL 6)\Job Errors
\Print Queue(FX DocuPrint M255 z PCL 6)\Not Ready Errors
\Print Queue(FX DocuPrint M255 z PCL 6)\Out of Paper Errors

More information about performance counters can be found in the Performance Counter Checks KB article.

NSClient++ via check_nt

NSClient++ does not include a printers module.

An alternative method is to query a performance counter, for example:

\Print Queue(FX DocuPrint M255 z PCL 6)\Job Errors
\Print Queue(FX DocuPrint M255 z PCL 6)\Not Ready Errors
\Print Queue(FX DocuPrint M255 z PCL 6)\Out of Paper Errors

More information about performance counters can be found in the Performance Counter Checks KB article.

NSClient++ via check_nrpe

NSClient++ does not include a printers module.

An alternative method is to query a performance counter, for example:

\Print Queue(FX DocuPrint M255 z PCL 6)\Job Errors
\Print Queue(FX DocuPrint M255 z PCL 6)\Not Ready Errors
\Print Queue(FX DocuPrint M255 z PCL 6)\Out of Paper Errors

More information about performance counters can be found in the Performance Counter Checks KB article.

WMI

Check WMI Plus includes the checkprint module. This example will go critical if several of the error thresholds are greater than 0.

Command:

./check_wmi_plus.pl -H 10.25.14.10 -u administrator -p Str0ngP@ssw0rd -m checkprint -s spooler -a 'FX DocuPrint M255 z PCL 6' -c JobErrors=0 -c NotReadyErrors=0 -c OutofPaperErrors=0

Output:

Overall Status - OK (Sample Period 50 sec) -  Printer Name="FX DocuPrint M255 z PCL 6" (OK) - _BytesPrintedPersec=0, JobErrors=0, Jobs=0, JobsSpooling=0, NotReadyErrors=0,
OutofPaperErrors=0, TotalJobsPrinted=0, TotalPagesPrinted=0|'FX DocuPrint M255 z PCL 6 _BytesPrintedPersec'=0; 'FX DocuPrint M255 z PCL 6 JobErrors'=0;0;
'FX DocuPrint M255 z PCL 6 Jobs'=0; 'FX DocuPrint M255 z PCL 6 JobsSpooling'=0; 'FX DocuPrint M255 z PCL 6 NotReadyErrors'=0;0; 'FX DocuPrint M255 z PCL 6 OutofPaperErrors'=0;0;
'FX DocuPrint M255 z PCL 6 TotalJobsPrinted'=0; 'FX DocuPrint M255 z PCL 6 TotalPagesPrinted'=0;

SNMP

SNMP is the most common method for checking the status of a printer. Due to the varying models of printers available it's not possible to provide examples of how to monitor each one. The Nagios Exchange is a great place to find plugins specific to your printer model.

You can of course check specific OID's via SNMP.

A generic OID could be hrDeviceStatus and it is OK if it returns a running state:

Command:

./check_snmp -H 10.25.21.1 -o hrDeviceStatus.1 -C box293 -P 2c -r running

Output:

SNMP CRITICAL - *warning(3)* |

 

You could also report on a specific OID for that device. In this example I am not generating any alert, I am just using it for information gathering.

Command:

./check_snmp -H 10.25.21.1 -o SNMPv2-SMI::mib-2.43.18.1.1.8.1.1 -C box293 -P 2c

Output:

SNMP OK - "093-426:Check Print Cartridge Soon.(Toner Cartridge)" | 

 

To be successful with SNMP checks you will need to download the MIB file from the manufacturer to understand what a "good" response is. This is why finding a plugin specific to your printer model from the Nagios Exchange can save you some time (and re-inventing the wheel).

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

Posted by: - Tue, Nov 28, 2017 at 9:05 PM. This article has been viewed 2174 times.
Online URL: https://support.nagios.com/kb/article/printer-checks-789.html

Powered by PHPKB (Knowledge Base Software)