<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On 5/10/11 9:46 AM, khurram aziz wrote:
<blockquote cite="mid:970205.70291.qm@web45910.mail.sp1.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt;">Hi,<br>
<br>
i am using Nagios 3.2.3 & want to enable SNMP Trap Handling
so that I can check uptime of my servers ( snmp service has
already been enabled on the servers).<br>
<br>
can sum1 help me with the configuration.<br>
</div>
</blockquote>
Well, first off you don't need snmp traps to check uptime.<br>
<br>
$ /usr/local/nagios/libexec/check_snmp -H localhost -o
.1.3.6.1.2.1.1.3.0 -C xxxxxx<br>
SNMP OK - Timeticks: (362041566) 41 days, 21:40:15.66 |<br>
$ <br>
<br>
If all you want to see is an uptime counter, add a service that does
that. Replace localhost with $HOSTADDRESS$, and replace xxxxxx with
your snmp community. Unfortunately, check_snmp doesn't seem to
support having warning or critical thresholds, so unless snmpd is
down, that will always return ok. You can use snmpget to get the
raw timeticks:<br>
<br>
$ snmpget -Ovt -v2c -c xxxxx localhost .1.3.6.1.2.1.1.3.0<br>
36207797<br>
$<br>
<br>
If you want a critical alert every time a box has rebooted, write a
shell script that calls that snmpget command, passing in the host
address and snmp community via the command line. Of course, that
will throw an Unknown while the box is actually down (snmp can't
tell if the host is down, or if you've passed the wrong snmp
community.)<br>
<br>
If what you really want is to know when your box is down, use
check_ssh:<br>
$ /usr/local/nagios/libexec/check_ssh localhost<br>
SSH OK - OpenSSH_5.1p1 FreeBSD-20080901 (protocol 2.0)<br>
$<br>
<br>
That will throw a critical any time it can't connect, or if it can
connect but the ssh version string isn't found.<br>
<br>
If you still want to use snmp traps, here's a link to some lovely
documentation:<br>
<br>
<a class="moz-txt-link-freetext" href="http://snmptt.sourceforge.net/docs/snmptt.shtml">http://snmptt.sourceforge.net/docs/snmptt.shtml</a><br>
<br>
There's even a section on integrating with Nagios, though I suggest
you get some coffee and a snack and read the whole page.<br>
<pre class="moz-signature" cols="72">--
Mike Lindsey</pre>
</body>
</html>