
		  check_snmp_disk * check_snmp_proc
		  =================================

What is it?
-----------

These are two plugins to be used with NetSaint or Nagios. You also
need the UCD SNMP Daemon in a reasonable new version.

NetSaint: http://www.netsaint.org/
Nagios:   http://www.nagios.org/

UCD-SNMPD (Net-SNMPD): http://www.net-snmp.org/


Who wrote it?
-------------

These programs are (C) 2002 by

Henning P. Schmiedehausen
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH
Am Schwabachgrund 22
D-91054 Buckenhof

Mail:  hps@intermeta.de
Web:   http://www.intermeta.de/

Distributed under GNU GENERAL PUBLIC LICENSE v2 (See file COPYING in
the distribution).

Document-ID: $Id: README,v 1.2 2002/01/27 15:33:10 henning Exp $


What can they do?
-----------------

UCD-SNMP gives you an unique feature: It makes checks from running
processes and/or disk size configurable in the SNMP daemon and
queryable via SNMP. So you can do

proc  syslogd
proc  klogd

disk  /    5%
disk  /usr 10%


in your snmpd.local.conf and have the snmp daemon check that you
always have free space on your root and usr file system and that you
have syslogd and klogd processes running.

Querying this from a monitoring tool however, is very cumbersome. You
need to check what disks are there, then query error status.

These two plugins does all the work for you.


Where do they run?
------------------

Well, on Linux. :-) That's where I wrote them. 

I use:

RedHat Linux 6.2
UCD SNMP 4.2.1 (RedHat 4.6.X incarnation)
NetSaint 0.0.7 Beta 8


If you port them to other platforms (which should be very simple. If
you get UCD and the monitor program to run on your platform, you're
basically there. The plugins use no other code).


How do I build and install?
---------------------------

- Unpack the distribution.

- Replace the common.h and config.h with the generated (!) files
  from your monitor program  build. If you don't do this, your plugins may
  still build but maybe the return code definitions are wrong.

- Check if your SNMP library needs -lcrypto to link (RedHat does)
  If not, remove -lcrypto from the supplied Makefile in LIBS.

- run "make". This should not report any errors.

- you should now have two binaries:  check_snmp_disk and check_snmp_plug

- copy them into your plugins directory.

- add the following two lines to your command.cfg:

command[check_snmp_disk]=/usr/netsaint/plugins/check_snmp_disk -H $HOSTADDRESS$ -C $ARG1$
command[check_snmp_proc]=/usr/netsaint/plugins/check_snmp_proc -H $HOSTADDRESS$ -C $ARG1$

  Replace /usr/netsaint/plugins/ with the directory where you copied
  the binaries!


How do I use it?
----------------

First, select something to check. You find a detailed description in
man snmpd.conf(5).

I, e.g. use (in /etc/snmpd/snmpd.local.conf under RedHat):

#
# SNMP checked disks
#
disk	/		5%
disk	/usr		5%
disk	/var		10%
disk	/boot		1%
disk	/mnt/disk0	10%
#
# SNMP checked Processes
#
proc	crond
proc	ntpd
proc	sshd
proc	syslogd
proc	klogd

Which assures that all my disks do not fill up and that I have the
most important processes running on my box.

You need a configured snmpd with at least a read community configured.

Now try your configuration: Run the disk plugin manually:

check_snmp_disk -H <host to check> -C <community>

It should report either

"Checked <xxx> disks."  and a return code of 0 if everything is fine
(<xxx> should be the number of disks configured in the snmp.local.conf
file),

or

"<diskname>: less than <xxx>% free (= <yyy>%) (<devicename>)" and a
return code of 2 if there is a problem (diskname and devicename depend
on the disk, <xxx> is the threshold configured and <yyy> is the actual
free space).


The same testing can be done with the check_snmp_proc plugin.

Now configure your monitor program to monitor a host (in hosts.cfg):

service[myhost]=DISK;0;24x7;3;5;1;admins;120;24x7;1;1;0;;check_snmp_disk!<community>
service[myhost]=PROC;0;24x7;3;5;1;admins;120;24x7;1;1;0;;check_snmp_proc!<community>

where <community is your read-community from above) and you're
set. The ";0;24x7;3;5;1;admins;120;24x7;1;1;0;;" parameters should be
of course your very own configuration. :-)


What is left to do?
-------------------

- Hard/Soft Thresholds 

- If multiple failures occur, only the first is reported
  (Netsaint/Nagios restriction) and every further error only when the
  first is fixed.


Release History
---------------

2002-01-27:          Version 0.1 released
                     First public version 0.2 finished

