Printers

Check your printer consumables status using SNMP

Description:

This plugin can check your printer consumables status using SNMP v1 queries.

Current Version

1.1

Last Release Date

2021-03-16

Compatible With

  • Nagios 3.x
  • Nagios 4.x

Owner

License

GPL


Project Photos
Project Notes
This plugin can check your printer consumables status using SNMP v1 queries. check_snmp_printer is written in Bash and is distributed under the GPLv2 license. This plugin have been created by Yoann LAMY. Usage: ./check_snmp_printer -H xxx.xxx.xxx.xxx -C public -t consumable -o black -w 85 -c 90 -H ADDRESS Name or IP address of host (default: 127.0.0.1) -C STRING Community name for the host's SNMP agent (default: public) -t STRING Check type (consumable, page, info) (default: page) -o STRING Consumable (black, cyan, magenta, yellow, drum) (default: black) -w INTEGER Warning level for consumable in percent (default: 0) -c INTEGER Critical level for consumable in percent (default: 0) -h Print this help screen -V Print version and license information This plugin uses the 'snmpget' command and 'snmpwalk' command included with the NET-SNMP package. This plugin support performance data output. If the percentage of the warning level and the critical level are 0, then the script returns a state OK. Examples : ./check_snmp_printer -H xxx.xxx.xxx.xxx -C public -t consumable -o black -w 85 -c 90 ./check_snmp_printer -H xxx.xxx.xxx.xxx -C public -t page This nagios plugins comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of the plugins under the terms of the GNU General Public License v2.
Reviews (8) Add a Review
A few questions:
by savage, September 30, 2022
A few questions:
How can i check waste bin?
can I check all toner level (black, cyan, magenta, yellow) in one command?
Helpful? Yes  No 
state "Unknown" for consumables in nagios web interface
by azertywxcvbn, October 31, 2016
Hello, first thank you for this plugin it's right the plugin I was searching.
But i've a problem for consumables. When i do :
./check_snmp_printer -H 127.0.0.1 -C public -t consummable -o black -w 85 -c 90
it return me : Utilisation of the black cartridge : 31% | cons_used=31;85;90;0
So i think it works in command lines but when i go on nagios web interface it writes me "Service State : unknown" for all consumables (not for pages)
Here is a part of my printer.cfg file :
define service {
host_name Wolf-P01/INFORMATIQUE, Workcentre Color 550/ENTRE MARKETING ET ACHAT
use generic-service
service_description Black
check_command check_snmp_printer_consummable!public!black!90!95
}
So i don't know from where it can come.

Thank you for the answer and sorry for my bad english (i'm french).
0 of 1 found this review helpful.
Helpful? Yes  No 1
Doesn't alarm as expected
by jriker1, December 31, 2015
I'll give credit for an almost perfect implementation. Problem I'm having is it doesn't actually set an alert. Using the examples above, and the fixes others provided, if I set the warning threshold to 90 and my consumables are 90 it shows green. If I set it to 89 it still shows green. Looks like it's not reading in the variable right or something.
Helpful? Yes  No 
very good working
by clatramp, January 31, 2014
on debian and ubuntu ,
needs some edit the script :
-from CMD_BASENAME="/bin/basename" to CMD_BASENAME="/usr/bin/basename"
-from CMD_AWK="/bin/awk" to CMD_AWK="/usr/bin/awk"

and all services check_snmp_printer_consummable need to add two exclamations and not one between the public and colour
example from check_command check_snmp_printer_consummable!public!yellow!90!95 to
check_snmp_printer_consummable!public!!yellow!90!95

working the black with Dell 2350dn Laser Printer
and all colours with HP LaserJet 100 colorMFP M175nw

thanks
Helpful? Yes  No 
Compiling Issue
by Def1ant, March 31, 2013
I am having the same issue as mmuniyap. This looks like exactly what I am looking for, I just can't seem to get it to function properly. I would appreciate any help you could offer. Thank you.
Helpful? Yes  No 
lexmark printers
by vyncynt, November 30, 2012
works well with lexmark printers.
just had to edit some lines for it to be compatible for other consumables.
Helpful? Yes  No 
Compiling the plugin
by mmuniyap, July 31, 2012
I tired to implement this pulgin but somehow the pulgin is not working. Got error - (Return code of 126 is out of bounds - plugin may not be executable), which turned out to be the problem that puligin was not complied and hence not found by the system. Please let me know how do i compile this printer pulgin alone.
Helpful? Yes  No 
Thanks for plugin.
by athlon128, December 31, 2010
Works fine with HP LaserJet 4350.
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.6 (13)
Favorites
2
Views
241,579