RE: SNMP Perl question: Limits on gettable?

Hans Jørgen Jakobsen <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>

On Wed, 1 Jun 2016, [email protected] wrote:

> No one?   Wrong place to ask?   Ill formed question?   Any hints?
I will try.
I have not used gettable in perl.
I wasn't aware that it was possible to specify selected coloums.

Have you tried the CLI snmptable? do it give all values?
Do snmpwalk throw some out of sequence warnings?

>
> Generally it is working, but I have one routine that attempts to query a cisco table as below, and in most cases it works, but for one large ASA with a lot of tunnels, it fails to return all rows in the table, returning what appears to be a random subset of about half  of them.  Using the snmpwalk command works fine.
>
> The code is as follows:
>
>    my %snmpparms;
>    $snmpparms{Community} = $community;
>    $snmpparms{DestHost} = inet_ntoa(inet_aton($IP));
>    $snmpparms{Version} = "2";
>    $snmpparms{UseSprintValues} = '1';
>    $snmpparms{UseEnums} = '0';
>    $snmpparms{UseNumeric} = '0';
>    $snmpparms{NonIncreasing} = '1';
>    $snmpparms{Timeout}=10000000;   # need long timeout for large tables over WAN
>    $sess = new SNMP::Session(%snmpparms);
>
>    # Now pull in the correlation table so we know which are real tunnels
>    my $RtnCorrHash = ( $sess->gettable('CISCO-IPSEC-FLOW-MONITOR-MIB::cikePeerCorrTable') );
>
>
> I've tried various combinations of the options in the session parameters without any change.  I've also tried placing a column list on the gettable without any change.
>
> I had this same problem with another large table and just converted it to specific calls to getbulk, but I rather liked using gettable in this case.
>
> There is no error returned from the gettable call.  The data returned is correct just incomplete.
>
> There are 54 items in the table, and each one looks sort of like this; only 25 rows were returned the last few times I tried (I am not sure if it always stops at 25 or not):
>
>          '1.13.51.56.46.49.52.48.46.49.51.52.46.49.56.1.11.53.48.46.50.52.49.46.50.46.55.55.500.25126' => {

You might wish you had put some xx in above line :-)

>                                                                                                             'cikePeerCorrIntIndex' => '500',
>                                                                                                             'cikePeerCorrRemoteValue' => '50.xxx.xxx.77',
>                                                                                                             'cikePeerCorrRemoteType' => '1',
>                                                                                                             'cikePeerCorrSeqNum' => '25126',
>                                                                                                             'cikePeerCorrIpSecTunIndex' => '25126',
>                                                                                                             'cikePeerCorrLocalValue' => '38.xxx.xxx.18',
>                                                                                                             'cikePeerCorrLocalType' => '1'
>                                                                                                           },
>
> The Cisco device is fairly new and on a high speed LAN; snmpwalk returns data very quickly, so I do not think this is some kind of timeout issue or anything related to packet fragmentation.  I am pulling a lot of data from it via zabbix and all those queries work fine.
>
> Any ideas why it will not return all values?

There might be errors in impl of gettable... Problems I would look for:

1) This mib uses 2 text as index. This might be a challenge.
Do it handle text of different lengths?

2) I think the table is dynamib. What happens whem a row (dis)appear 
while walking?

Try making tcpdump to figure out where and why it stops.

Be aware that you probable will spend more time debuging than rewriting 
the code to use snmp(bulk)walk :-)
/hjj

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.