Same status

Karl DeBisschop karl at debisschop.net
Wed Jan 15 13:04:22 CET 2003


On Tue, 2003-01-14 at 10:36, Carroll, Jim P [Contractor] wrote:
> I've been pondering SNMP as an alternative to NRPE.  If I were to take this
> approach, I presume I need the following:

OK. First note my caveat. It's easy on RedHat linux. It's probably easy
on almost any linux. YMMV with other vendors (although in general, most
embedded devices, siwtches, etc are good if you can get or guess the
MIB)

> - the SNMP software components need to be installed on the Nagios server as
> well as for any client I wish to monitor (should be obvious, but I didn't
> want to skip over this ;)
> - proper config of SNMP so that it's functioning client/server
> - the check_snmp plugin should be built properly

These ought to be straightforward. But yes, complete = good

> - I'm guessing I need a MIB for whatever aspect I'm trying to monitor...?
> E.g., o/s, hardware, specific application

It helps, but not really needed. I often use the numeric OID

> - the biggest gap is w.r.t. what a service definition would look like; if
> you could post a couple examples (eg, memory, disk) that would be most
> excellent, sir :)

There are some service definitions in the old command.cfg file.

> For further reference, it would be great if you could take me through the
> creation of a single definition, from the "gee, I'd like to monitor service
> XYZ on host xyzygy" to looking up the MIB details (or snmpwalk or whatever's
> required), that'd be great!

OK. I happen to have a RedHat beta on my laptop here. No nagios, no
snmp. Let's see just how painful this is, since it's been a few years
since I first set ip up.

1) rpm -Uv net-snmp*

2) edit /etc/snmp/snmpd.conf (comments in file are enough to tell you
what to do)

3) sudo /sbin/service snmpd restart

4) test with `snmpwalk -c public -v 1 localhost system`

5) snmpwalk -c public -v 1 localhost .1 | less

6) now, since people asked about checking load without 3 test in another
thread, I'll run

   snmpwalk -c public -v 1 localhost .1.3.6.1.4.1.2021.10

Part of what comes back is

 UCD-SNMP-MIB::laLoad.1 = STRING: 0.00
 UCD-SNMP-MIB::laLoad.2 = STRING: 0.07
 UCD-SNMP-MIB::laLoad.3 = STRING: 0.23

Or, if you prefer:

    snmpwalk -O n -c public -v 1 localhost .1.3.6.1.4.1.2021.10

 .1.3.6.1.4.1.2021.10.1.3.1 = STRING: 0.12 
 .1.3.6.1.4.1.2021.10.1.3.2 = STRING: 0.10
 .1.3.6.1.4.1.2021.10.1.3.3 = STRING: 0.09

So I can define a load check like:

/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ \
-o .1.3.6.1.4.1.2021.10.1.5.1 \
-o .1.3.6.1.4.1.2021.10.1.5.2 \
-o .1.3.6.1.4.1.2021.10.1.5.3 \
-w :$ARG2$,:$ARG3$,:$ARG4$ \
-c :$ARG5$,:$ARG6$,:$ARG7$ \
-l load

(Sorry about the line wraps.)


Here's a few new style commands from ny currently running configuration:

define command{
        command_name    snmp_procs
        command_line    /usr/lib/nagios/plugins/check_snmp \
-H $HOSTADDRESS$ -C $USER5$ \
-o host.hrSystem.hrSystemProcesses.0 \
-w :$ARG1$ -c :$ARG2$ -l processes
        }

define command{
        command_name    snmp_disk
        command_line    /usr/lib/nagios/plugins/check_snmp \
-H $HOSTADDRESS$ -C $USER5$ \
-o .1.3.6.1.4.1.2021.9.1.9.1 \
-w :$ARG1$ -c :$ARG2$ -l percent
        }

define command{
        command_name    snmp_inodes
        command_line    /usr/lib/nagios/plugins/check_snmp \
-H $HOSTADDRESS$ -C $USER5$ \
-o .1.3.6.1.4.1.2021.9.1.10.1 \
-w :$ARG1$ -c :$ARG2$ -l percent
        }

Hope that helps.

--
Karl




-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en




More information about the Users mailing list