nagios and snmp
I've finally got around to installing nagios yesterday and all seems to be fine. I would like to monitor my printers (a xerox 8550DP and a brother mfc 8860), but I'm having trouble getting the check_snmp to work. I was wondering if anyone else has had any experience using nagios to monitor said printers.
You need to look at the mibs for those printers to see if you can find out what to monitor then add that to a check.
You can run snmpwalk over them too to get the locations of the required info
Yes you can but you may not understand which snmp values to plug in to your check.
Ideally, you need to get the MIB file(s) for the printer from the manufacturer. That way you can work out what snmp node you need to query.
I wrote this to check my Phaser 8400s but I have found it seems to work on most printers as the OIDs must be standard. I have used it on the HP printers the dont like the HPJD plugin.
I think this is my final version but I am not in a position to check at the mo.
# Author : Chris Hindmarch
# Date : 17/10/2006
# Uses SNMP to check a Phaser 8400 status
# and determines the status of the printer.
if ( !defined $ARGV || !defined $ARGV)
print "Arg 1 = $ARGV Arg 2 = $ARGV";
#print "One or more arguments are missing";
# Set the default status to 3.
$mystatus = 3;
# Set the community string and host from the arguments
# used to call the script
# Get the results of the OID and put it into a variable
#$result = `snmpwalk -v1 -c $COMMUNITY $IP 188.8.131.52.4.1.9600.1.1.1.184.108.40.206.220.127.116.11.108`;
# Check the first static OID to see if there is a message
$result = `snmpwalk -v1 -c $COMMUNITY $IP mib-18.104.22.168.22.214.171.124`;
# Use a regex to make sure the data has been returned
if ($result =~ m/(= STRING: ")(.*)(")$/)
$mystatus = 0;
print "PRINTER OK - ($2)\n";
$result = $2;
if ($result =~ m/Ink low/)
$mystatus = 1;
else # Go get the error message
# Get the message from the OID range that contains other messages
# if the above OID does not return a valid result.
$result = `snmpwalk -v1 -c $COMMUNITY $IP mib-126.96.36.199.1.8.1`;
if ($result =~ m/(Job)(.*)(")$/)
print "PRINTER WARNING - ($1$2)\n";
$mystatus = 1;
$result =~ m/(= STRING: ")(.*)(")$/;
print "CRITICAL - ($2)\n";
$mystatus = 2;
I have just had the same problem with the snmp plugin.
Originally Posted by uk101man
you need to make sure that you have net-snmp installed on your system.
yum install net-snmp
yum install net-snmp-utils
yum install net-snmp-devel
with them installed reinstall you plugins and it should compile the check_snmp plugin:)
He wasn't neccessarily saying that check_snmp wasn't working but that he wanted to use it to check his snmp printers.
Thanks for the replies. Chris I'll give your script a go once I've finished kicking in GDI for a couple of hours ;-)
chekc_snmp does work and i knew that i would need an mib and believe i found the mib i would like to monitor but when i tried it did not work.
Like i said i'll give Chris's script a go...oh there is a standard call checkprinter mib or something like that.
"In the name of Kane"
This script looks helpful, could someone please tell me the simple steps to make this work with nagios? I've attempted to make it an exec and put it in the commands.cfg file without success. thanks, and sorry for my ignorance.