Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check your printer consumables status using SNMP
1.1
2021-03-16
- Nagios 3.x
- Nagios 4.x
GPL
242042
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
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.
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)
bysavage, September 18, 2022
A few questions:
How can i check waste bin?
can I check all toner level (black, cyan, magenta, yellow) in one command?
How can i check waste bin?
can I check all toner level (black, cyan, magenta, yellow) in one command?
byazertywxcvbn, October 6, 2016
0 of 1 people found this review helpful
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).
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).
byjriker1, December 22, 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.
Owner's reply
What is the printer model ?
What is the result of this command ?
> snmpwalk -v 1 -c public xxx.xxx.xxx.xxx .1.3.6.1.2.1.43.11.1.1.6.1
Regards.
byclatramp, January 28, 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
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
byDef1ant, March 25, 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.
byvyncynt, November 27, 2012
works well with lexmark printers.
just had to edit some lines for it to be compatible for other consumables.
just had to edit some lines for it to be compatible for other consumables.
bymmuniyap, 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.
byathlon128, December 29, 2010
Works fine with HP LaserJet 4350.