The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Xymon::SNMP - Xymon Interface to SNMP

SYNOPSIS

  use Xymon::SNMP;
  
  my $snmp = Xymon::Monitor::SNMP->new({
                hostname=>"$host",
                version=>"2c",
                community=>"public",
                oidconfig=>"liebert.conf"
                }
  );

  $snmp->run();
  $snmp->close();

DESCRIPTION

Provides an interface for monitoring snmp based devices using a configuration file to determin which oids to retrieve, their thresholds and what tests they are mapped to.

USAGE

An example configuration file:

        #
        # Output Current
        #
        <current>
                OIDS = 1.3.6.1.2.1.33.1.4.4.1.3.1
                OIDS = 1.3.6.1.2.1.33.1.4.4.1.3.2
                OIDS = 1.3.6.1.2.1.33.1.4.4.1.3.3
                
                THRESH = 350
                THRESHDIR = >
        </current>
        
        #
        # Percentage of maximum output current
        #
        <percentload>
                OIDS = 1.3.6.1.2.1.33.1.4.4.1.5.1
                OIDS = 1.3.6.1.2.1.33.1.4.4.1.5.2
                OIDS = 1.3.6.1.2.1.33.1.4.4.1.5.3
                
                THRESH = 90
                THRESHDIR = >
        </percentload>

The config file is loaded when the snmp object is created:

my $snmp = Xymon::Monitor::SNMP->new({ hostname=>"router1", version=>"2c", community=>"public", oidconfig=>"router.conf" } );

This configuration file is used to map the OIDS listed and retrieve the data as below where the first field is the host name, the second is the testname, the third is the field within the test, the fourth is the return value from snmp, the fifth is the comparison operator and the sixth field is the threshold:

        router1:percentload:percentload1:44:>:90
        router1:percentload:percentload2:41:>:90
        router1:percentload:percentload3:31:>:90
        router1:batterystatus:batterystatus:2:<>:2
        router1:battcharge:battcharge:100:<:100
        router1:batteryminutes:batteryminutes:29:<:15,
        router1:current:current1:152:>:350
        router1:current:current2:153:>:350
        router1:current:current3:113:>:350

These are used to generate the message to send to Xymon. The first for eaxmple would be equivalent to:

        bb 127.0.0.1 "status router1.percentload green 
        
        percentload1:44
        percentload2:41
        percentload3:31"

The above is an explanation of what happens behind the scenes, however the actual generation and sending of the message to Xymon is all taken care of when you perform the run method.

AUTHOR

    David Peters
    CPAN ID: DAVIDP
    davidp@electronf.com
    http://www.electronf.com

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO

perl(1).