in reply to SNMP Test for mib

You could try using Net::SNMP
If you do a get_request on an OID which is not supported by the device, it returns and error, and the error_status() is set to 2 (noSuchName). For example:
#! /usr/local/bin/perl use strict; use Net::SNMP; my ($session, $error) = Net::SNMP->session( -hostname => shift || '192.168.5.242', -community => shift || 'public', -port => shift || 161 ); if (!defined($session)) { printf("ERROR: %s.\n", $error); exit 1; } my $sysUpTime = '1.3.6.1.2.1.1.3.0.1'; my $result = $session->get_request( -varbindlist => [$sysUpTime] ); if (!defined($result)) { printf("ERROR: %s.\n", $session->error); my $error_status=$session->error_status; printf("Error Status: %s \n", $error_status); $session->close; if ($error_status == 2) { print "This device does not support the MIB requested.\n"; } exit 1; } printf("sysUpTime for host '%s' is %s\n", $session->hostname, $result->{$sysUpTime} ); $session->close; exit 0;
What's wrong with this OID is that I have added '.1' to the end of a normal sysUptime OID.