Home Directory Plugins Network Protocols SNMP Updated check_print_toner

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Updated check_print_toner

Rating
1 vote
Favoured:
0
Hits
157209
Files:
FileDescription
check_print_tonerThe Plugin - 15/04/2008 - Bug Fix
Nagios CSP

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!
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.
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.