SNMP

Updated check_print_toner

Description:

An updated version of the check_print_toner plugin by SoOlf. This plugin keeps its own record of the previous check for each toner. This is to help handle network printers which are not always switched on.

Current Version

Last Release Date

June 23, 2009

Compatible With

Owner


Project Files
Project Notes
Requires snmpget. USAGE: check_print_toner COMMUNITY_NAME HOST_IP TONER_NUMBER TONER_NUMBER is an integer number between 1 and 4. So far all the printers I have come across are as follows: 1 = Black, 2 = Cyan, 3 = Magenta, 4 = Yellow. Logs are kept in the directory /usr/local/nagios/var/check_print_toner_logs by default (does this have any security issues?), which must be created with read and write access for the nagios user and group before running the check. This can be changed by editing the file variable near the top of the code. Each toner has its own log file. I originally wanted to store all information in a single file, but I couldn't figure out a way to lock the log file efficiently and kept getting time out problems. Without a lock, the log file became very messy as multiple toner checks were happening at once, and interfered with each others writes. The code still allows for a single log file to be used, but I have taken out any code I used which attempted to lock it. If anybody can implement this, that would be great! There is still no help command or argument error parsing, but I find it works smoother than the original plugin. Check result conditions are as follows: OK: There is a SNMP response from the printer. The toner is more than 5% full. WARNING: The toner is between 3% and 5% full. WARNING: The printer was not online for the first check WARNING: There is no SNMP response from the printer, even though it is switched on. CRITICAL: The toner is 2% full or less. CRITICAL: The printer has not been online for 30 days or more. STATUS UNCHANGED FROM PREVIOUS RESULT: The printer is offline, but the toner level has been checked before, and the printer was last online less than 30 days ago. **Bugfix - 15/04/2008** Fixed two bugs which sent an invalid output when toner levels became critical. **Bug Fix - 17/03/2008** I found a bug which is now fixed. The datestamp on the logs was not been updated by the plugin. Please use the new version.
Reviews (0) Add a Review
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
5 (1)
Favorites
0
Views
157,263