Here is the requested output.
debug: [627] Net::SNMP::Transport::_new(): opened UDP/IPv4 socket [3]
debug: [968] Net::SNMP::Message::_prepare_object_identifier(): leading
dot present
debug: [448] Net::SNMP::Dispatcher::_event_insert(): created new head
and tail [ARRAY(0x473af0)]
debug: [593] Net::SNMP::Dispatcher::_event_handle(): event
[ARRAY(0x473af0)], poll delay = 0.000000
debug: [646] Net::SNMP::Message::send(): transport address
10.144.121.51:161
debug: [1896] Net::SNMP::Message::_buffer_dump(): 51 bytes
[0000] 30 31 02 01 01 04 0B 63 68 61 72 74 65 72 39 33
01.....charter93
[0016] 70 61 A0 1F 02 02 22 7A 02 01 00 02 01 00 30 13
pa...."z......0.
[0032] 30 11 06 0D 2B 06 01 04 01 89 0E 01 81 48 04 03
0...+........H..
[0048] 00 05 00 ...
debug: [202] Net::SNMP::Dispatcher::register(): adding descriptor [3]
debug: [471] Net::SNMP::Dispatcher::_event_insert(): modified tail
[ARRAY(0x473dfc)]
debug: [542] Net::SNMP::Dispatcher::_event_delete(): deleted
[ARRAY(0x473af0)], defined new head [ARRAY(0x473dfc)]
debug: [593] Net::SNMP::Dispatcher::_event_handle(): event
[ARRAY(0x473dfc)], poll delay = 0.999402
debug: [645] Net::SNMP::Dispatcher::_event_select(): descriptor [3]
ready for read
debug: [670] Net::SNMP::Message::recv(): transport address
10.144.121.51:161
debug: [1896] Net::SNMP::Message::_buffer_dump(): 52 bytes
[0000] 30 32 02 01 01 04 0B 63 68 61 72 74 65 72 39 33
02.....charter93
[0016] 70 61 A2 20 02 02 22 7A 02 01 00 02 01 01 30 14 pa.
.."z......0.
[0032] 30 12 06 0D 2B 06 01 04 01 89 0E 01 81 48 04 03
0...+........H..
[0048] 00 02 01 01 ....
error: [869] Net::SNMP::PDU::_process_pdu_sequence(): Received
noError(0) error-status at error-index 1
error: [268] Net::SNMP::MessageProcessing::prepare_data_elements():
Received noError(0) error-status at error-index 1
error: [407] Net::SNMP::Dispatcher::_transport_response_received():
Received noError(0) error-status at error-index 1
debug: [524] Net::SNMP::Dispatcher::_event_delete(): deleted
[ARRAY(0x473dfc)], list is now empty
debug: [241] Net::SNMP::Dispatcher::deregister(): removing descriptor
[3]
error: [2304] Net::SNMP::__ANON__(): Received noError(0) error-status at
error-index 1
debug: [968] Net::SNMP::Message::_prepare_object_identifier(): leading
dot present
debug: [448] Net::SNMP::Dispatcher::_event_insert(): created new head
and tail [ARRAY(0x473940)]
debug: [593] Net::SNMP::Dispatcher::_event_handle(): event
[ARRAY(0x473940)], poll delay = 0.000000
debug: [646] Net::SNMP::Message::send(): transport address
10.144.121.51:161
debug: [1896] Net::SNMP::Message::_buffer_dump(): 52 bytes
[0000] 30 32 02 01 01 04 0B 63 68 61 72 74 65 72 39 33
02.....charter93
[0016] 70 61 A0 20 02 02 22 7B 02 01 00 02 01 00 30 14 pa.
.."{......0.
[0032] 30 12 06 0E 2B 06 01 04 01 89 0E 01 81 48 0C 01
0...+........H..
[0048] 07 00 05 00 ....
debug: [202] Net::SNMP::Dispatcher::register(): adding descriptor [3]
debug: [471] Net::SNMP::Dispatcher::_event_insert(): modified tail
[ARRAY(0x473e2c)]
debug: [542] Net::SNMP::Dispatcher::_event_delete(): deleted
[ARRAY(0x473940)], defined new head [ARRAY(0x473e2c)]
debug: [593] Net::SNMP::Dispatcher::_event_handle(): event
[ARRAY(0x473e2c)], poll delay = 0.999516
debug: [645] Net::SNMP::Dispatcher::_event_select(): descriptor [3]
ready for read
debug: [670] Net::SNMP::Message::recv(): transport address
10.144.121.51:161
debug: [1896] Net::SNMP::Message::_buffer_dump(): 53 bytes
[0000] 30 33 02 01 01 04 0B 63 68 61 72 74 65 72 39 33
03.....charter93
[0016] 70 61 A2 21 02 02 22 7B 02 01 00 02 01 00 30 15
pa.!.."{......0.
[0032] 30 13 06 0E 2B 06 01 04 01 89 0E 01 81 48 0C 01
0...+........H..
[0048] 07 00 02 01 01 .....
debug: [1440] Net::SNMP::Message::_process_object_identifier(): adding
leading dot
debug: [953] Net::SNMP::PDU::_process_var_bind_list(): {
.1.3.6.1.4.1.1166.1.200.12.1.7.0 => INTEGER: 1 }
debug: [524] Net::SNMP::Dispatcher::_event_delete(): deleted
[ARRAY(0x473e2c)], list is now empty
debug: [241] Net::SNMP::Dispatcher::deregister(): removing descriptor
[3]
AC Power Status
Number of Batteries 1
Show quoted text-----Original Message-----
From: David M. Town via RT [mailto:bug-Net-SNMP@rt.cpan.org]
Sent: Saturday, November 29, 2008 8:50 AM
To: Michaels, Kevin
Subject: [rt.cpan.org #41295] Net:SNMP not pulling one particualr OID
<URL:
http://rt.cpan.org/Ticket/Display.html?id=41295 >
There is no obvious error that I can see in your usage of the Net::SNMP
module. Can you enable debugging by adding the argument "-debug =>
0xff" to the session() constructor and send me the output produced by
running the script in question?
On Fri Nov 28 10:39:45 2008, KMichaels@atlanticbb.com wrote:
> Could someone please give me some assistance with one particular OID I
> can't seem to query:
>
>
>
>
>
>
>
> I am using the Net::SNMP module to pull values of cable modem and
> logging the results to a database.
>
>
>
> One of the OID's I am trying to pull are not giving me any results,
and
> I can't see why.
>
>
>
> The OID is .1.3.6.1.4.1.1166.1.200.4.3.0
>
>
>
> Snmpget works for that OID:
>
>
>
> #snmpget -v2c -c aaaaaaaa xx.xx.xx.xx .1.3.6.1.4.1.1166.1.200.4.3.0
>
> SNMPv2-SMI::enterprises.1166.1.200.4.3.0 = INTEGER: 1
>
>
>
> Here is an example of the script I am running:
>
>
>
>
>
> #! /usr/local/bin/perl
>
>
>
> use Net::SNMP;
>
>
>
> $numberbat =".1.3.6.1.4.1.1166.1.200.12.1.7.0";
>
> $ac = ".1.3.6.1.4.1.1166.1.200.4.3.0";
>
>
>
> ($session, $error) = Net::SNMP->session(
>
> -hostname => shift || "xx.xx.xx.xx",
>
> -community => shift || 'xxxxxxx',
>
> -version => shift || '2',
>
> -timeout => shift || 1);
>
>
>
> $result = $session->get_request($ac);
>
> $AcPowerStatus = $result->{$ac};
>
>
>
> $result = $session->get_request($numberbat);
>
> $NumberofBatteries = $result->{$numberbat};
>
>
>
> print "AC Power Status $AcPowerStatus ";
>
> print "\nNumber of Batteries $NumberofBatteries ";
>
>
>
>
>
> Which gives me this output:
>
>
>
> AC Power Status
>
> Number of Batteries 1
>
>
>
> Any help that I can get to figure this out would be great.
>
>
>
> Thanks in advance.
>
>
>
> Kevin L. Michaels
>
>
>