*nix Thread, nagios and snmp in Technical; Hello,
I've finally got around to installing nagios yesterday and all seems to be fine. I would like to monitor ...
-
12th March 2008, 10:06 AM #1
- Rep Power
- 14
nagios and snmp
Hello,
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.
Tom
-
-
IDG Tech News
-
12th March 2008, 10:08 AM #2 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.
Ben
-
-
12th March 2008, 11:00 AM #3 You can run snmpwalk over them too to get the locations of the required info
-
-
12th March 2008, 11:04 AM #4 Yes you can but you may not understand which snmp values to plug in to your check.
Ben
-
-
12th March 2008, 11:41 AM #5 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.
-
-
12th March 2008, 11:55 AM #6 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.
Code:
#!/usr/bin/perl -w
# 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[0] || !defined $ARGV[1])
{
print "Arg 1 = $ARGV[0] Arg 2 = $ARGV[2]";
#print "One or more arguments are missing";
exit 3;
}
# Set the default status to 3.
$mystatus = 3;
# Set the community string and host from the arguments
# used to call the script
$COMMUNITY=$ARGV[0];
$IP=$ARGV[1];
# Get the results of the OID and put it into a variable
#$result = `snmpwalk -v1 -c $COMMUNITY $IP 1.3.6.1.4.1.9600.1.1.1.1.5.6.95.84.111.116.97.108`;
# Check the first static OID to see if there is a message
$result = `snmpwalk -v1 -c $COMMUNITY $IP mib-2.43.16.5.1.2.1.1`;
#print "$resultat";
# 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
{
$result ="";
# 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-2.43.18.1.1.8.1`;
if ($result =~ m/(Job)(.*)(")$/)
{
print "PRINTER WARNING - ($1$2)\n";
$mystatus = 1;
}
else
{
$result =~ m/(= STRING: ")(.*)(")$/;
print "CRITICAL - ($2)\n";
$mystatus = 2;
}
}
exit $mystatus;
-
-
12th March 2008, 12:49 PM #7 
Originally Posted by
uk101man
Hello,
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.
Tom
I have just had the same problem with the snmp plugin.
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
-
-
12th March 2008, 01:01 PM #8 He wasn't neccessarily saying that check_snmp wasn't working but that he wanted to use it to check his snmp printers.
Ben
-
-
12th March 2008, 09:08 PM #9
- Rep Power
- 14
thanks
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"
-
-
18th April 2008, 01:58 AM #10
- Rep Power
- 0
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.
-
SHARE:
Similar Threads
-
By rush_tech in forum *nix
Replies: 5
Last Post: 13th July 2010, 04:27 PM
-
Replies: 51
Last Post: 10th November 2009, 06:23 AM
-
By complete_phreak in forum Hardware
Replies: 11
Last Post: 11th April 2008, 10:12 AM
-
By plexer in forum How do you do....it?
Replies: 4
Last Post: 17th July 2007, 07:43 PM
-
By browolf in forum Windows
Replies: 1
Last Post: 11th May 2006, 09:26 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules