Help with SNMP get_request
am 21.04.2006 21:49:33 von spWhen I run the perl code I get the following:
<<<< OUTPUT >>>>
Session: Net::SNMP=HASH(0x85123b4)
Error:
OID: 1.3.6.1.4.1.232.3.2.5.1.1.3.1.132
Disk Info: HASH(0x8143750)
I'm just starting to use the NET::SNMP module and i'm not sure what I'm
doing wrong.
Thanks for the help
Sal
#---------------------------------------------------
my ($session, $error);
if ($o_snmp_ver eq "2c")
{
# SNMPv2 Login
($session, $error) = Net::SNMP->session
(
-hostname => $o_host,
-version => 2,
-community => $o_community,
);
}
print "Session: ",$session,"\n","Error: ",$error,"\n";
#Build the OID string
$oid_to_get = $drive_model_trgt . "." . $o_ctrl_num . "." .
$o_disk_num;
#Get disk status
if (!defined($disk_info[1] = $session->get_request($oid_to_get)))
{
$error_msg=$session->error;
print "ERROR - Target: ",$o_host,"\n";
print "Community: ",$o_community,"\n";
print "OID: ",$oid_to_get,"\n";
print "Error: ",$error_msg,"\n";
$session->close;
}
$session->close;
print "OID: ", $oid_to_get, "\n";
print "Disk Info: ",$disk_info[1], "\n";
------------------------------------------------------------ ---------