check_snmp and mulitple oid returns

jgking at packetstorm.org jgking at packetstorm.org
Mon Jan 27 15:18:50 CET 2003


Ive been searching the list archives for the last 30 minutes have been 
having alot of hits close to it but either im not understanding or its 
different than what im asking.

Instead of having, say 5 seperate snmp check entries in the services.cfg 
file, i would rather consolidate it into one single check and look for an 
oid return value that meets the error criteria.

For example, disk percent usage. 

In snmpd.conf i setup the following:

disk / 10000
disk /boot 10000
disk /data 10000
disk /home 817928
disk /tmp  10000
disk /usr 10000
disk /var 10000

Now that this will do is set the errorflag field if anything matches 

.iso.3.6.1.4.1.2021.9.1.101.1 = ""
.iso.3.6.1.4.1.2021.9.1.101.2 = ""
.iso.3.6.1.4.1.2021.9.1.101.3 = ""
.iso.3.6.1.4.1.2021.9.1.101.4 = "/home: less than 817928 free (= 807928)"
.iso.3.6.1.4.1.2021.9.1.101.5 = ""
.iso.3.6.1.4.1.2021.9.1.101.6 = ""


In my checkcommands file I have the following:

define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $ARG1$ -o $ARG2$ -s $ARG3$ 
-C $ARG4$ 
        }


And in the services file I have this

define service{
        use                             generic-service         ; Name of 
service template to use

        host_name                       localhost
        service_description             Disk: Usage
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        contact_groups                  admins
        notification_interval           120
        notification_period             24x7
        notification_options            w,u,c,r
        check_command                   
check_snmp!localhost!.1.3.6.1.4.1.2021.9.1.101.1,.1.3.6.1.4.1.2021.9.1.101.2,.1.3.6.1.4.1.20
21.9.1.101.3,.1.3.6.1.4.1.2021.9.1.101.4,.1.3.6.1.4.1.2021.9.1.101.5,.1.3.6.1.4.1.2021.9.1.101.6!""!*******
        }


Which I find returns an OK unless the last oid checked is the one that 
fails. 

So is there a way to have check_snmp return a fail if any oid in the group 
fails? 


Thanks!
Greg



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list