Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Net::Snmp->session->get_table() data missing

by sherman (Initiate)
on Jul 02, 2015 at 02:22 UTC ( #1132907=perlquestion: print w/replies, xml ) Need Help??

sherman has asked for the wisdom of the Perl Monks concerning the following question:

Not sure if anyone raised this before, please point me to the right thread if someone has answer this before.

I found Net::Snmp->get_table() failed to return all data. Net::Snmp version: 6.0.1.

I tried to retrieve a nic usagge on a window box but one of interface was not included on get_table() result the debug shows the missing PDU was retrieved from the window box, but not included in the return result object for some reason

debug: 965 Net::SNMP::PDU::_process_var_bind_list(): { 1.3.6.1.2.1.2.2.1.2.19 => OCTET STRING: Microsoft ISATAP Adapter #4 }

debug: 1506 Net::SNMP::Message::_process_octet_string(): not translating OCTET STRING, all octets are allowed in a DisplayString

debug: 965 Net::SNMP::PDU::_process_var_bind_list(): { 1.3.6.1.2.1.2.2.1.2.20 => OCTET STRING: GES EX (Giga Ethernet System) Express PCI Adapter (NDIS) }

debug: 1506 Net::SNMP::Message::_process_octet_string(): not translating OCTET STRING, all octets are allowed in a DisplayString

debug: 965 Net::SNMP::PDU::_process_var_bind_list(): { 1.3.6.1.2.1.2.2.1.2.21 => OCTET STRING: Microsoft ISATAP Adapter #5 }

debug: 1506 Net::SNMP::Message::_process_octet_string(): not translating OCTET STRING, all octets are allowed in a DisplayString

debug: 965 Net::SNMP::PDU::_process_var_bind_list(): { 1.3.6.1.2.1.2.2.1.2.22 => OCTET STRING: GES EX (Giga Ethernet System) Express PCI Adapter (NDIS) #2 }

debug: 1506 Net::SNMP::Message::_process_octet_string(): not translating OCTET STRING, all octets are allowed in a DisplayString

debug: 965 Net::SNMP::PDU::_process_var_bind_list(): { 1.3.6.1.2.1.2.2.1.2.23 => OCTET STRING: Microsoft ISATAP Adapter #6 }

Data Return by Net::Snmp->session->get_table()

OID : 1.3.6.1.2.1.2.2.1.2.19, Desc : Microsoft ISATAP Adapter #4

List : Microsoft ISATAP Adapter #4

OID : 1.3.6.1.2.1.2.2.1.2.22, Desc : GES EX (Giga Ethernet System) Express PCI Adapter (NDIS) #2 List : GES EX (Giga Ethernet System) Express PCI Adapter (NDIS) #2

The OID: 1.3.6.1.2.1.2.2.1.2.20 was discarded during the process for some reason

Does anyone has idea how I get the missing PDU return properly?

Thanks

Sherman

  • Comment on Net::Snmp->session->get_table() data missing

Replies are listed 'Best First'.
Re: Net::Snmp->session->get_table() data missing
by 1nickt (Abbot) on Jul 02, 2015 at 20:02 UTC

    Hi Sherman, welcome to the monastery.

    If you format your post according to the guidelines, including putting any code between <code> ... </code> tags, there'll be a much better chance that someone will be able to help you.

    My first question to you is, have you read all the documentation for Net::SNMP ?

    Remember: Ne dederis in spiritu molere illegitimi!
Re: Net::Snmp->session->get_table() data missing
by akuk (Beadle) on Jul 03, 2015 at 04:22 UTC

    Hi Have you tried to get the table value from command line using snmpwalk utility ? Does it return some data ? Please post the code also which is not functioning properly ?

    Code Snippet of get_table()

    my $ip = "your_ip_device"; my $snmpCommunity = "your_snmp_community"; my $oid = "oid_you_want_to_poll"; my $port = "you_snmp_port"; # By default its 161 my ($session, $error) = Net::SNMP->session( -hostname => "$ip", -community => "$snmpCo +mmunity", -timeout => "30", -version => "2", -port => "$port"); if(!defined($session)){ printf("ERROR : %s.\n", $error); exit 1; } my $response = $session->get_table($oid);

    Do you want to varbind the variable using SNMPTRAP ?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1132907]
Approved by marinersk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2020-08-15 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (79 votes). Check out past polls.

    Notices?