1 Reply Latest reply on Jul 11, 2009 2:23 AM by webcontrol

    Nested SNMP Query


      Windows servers tend to change their interface numbering after a reboot. If you monitor the inteface operational status with snmp this might lead to a false alert after a reboot.

      We monitor crosslinks between storageservers (where data get syncronized) to get notfied if the interface goes down and syncronisation would be broken. Now from time to time single storageservers have to be rebootet, e.g. due to newly installed updates. Each time this happens we have to disbale the monitor, change the OID to the new interface number and enable the monitor again. Allthough this is not a time consuming task you can bet no technican will ever remeber about it and and therefore we get false alerts.

      Wouldnt it be a good idea to have nested snmp queries in IpMonitor? Windows stores the interface number in an oid called + the interface ip address, e.g. If you query that oid you get e.g. 3 as a numeric result. If you append this result to the oid (IfOperStatus) (in this case you get the operational status of the interface.

      This applies to many other snmp monitors and devices where you know the ip address and want to monitor the interface the ip is bound to. A new snmp monitor type would solve the problem by allowing to get a value from one oid and append it to the oid you want to monitor.

      Is such a feature on your todo list or is it already there and we are just blind?



        • Re: Nested SNMP Query

          Since there was no reply to our question we wrote perl script doing what we want.

          <-- snip -->

          use Net::SNMP;

          my $host = $ARGV[0];
          my $ip = $ARGV[1];
          my $ifnumber = "$ip";

          my ($session, $error) = Net::SNMP->session(
                          -hostname  => $host,
                          -version   => 'snmpv2c',
                          -community => 'public',
                          -port      => 161

          my $result_ifnumber = $session->get_request($ifnumber);
          my $ifoperstatus = "" . $result_ifnumber->{$ifnumber};
          my $result_ifoperstatus = $session->get_request($ifoperstatus);
          # print $result_ifoperstatus->{$ifoperstatus};

          exit $result_ifoperstatus->{$ifoperstatus};

          <-- snap -->

          Use this script with an external process monitor. In the Command Line Parameters field just enter the scriptname followed by the ip address of the host you want to monitor and as second parameter the ip address of the interface you want to monitor on that host: