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

Hello all! I'm trying to get CPU information from some Cisco switches. I'm using the 'cpmCPUTotalTable' MiB entry to gather that information.

I can get the information using the snmptable and snmpbulkget command line commands.

However, when I try to use the SNMP module (not the Net::SNMP module) to get that same information, I get nothing. No error, no data. I tried using Dump to view the result, and got an empty variable. The same command structure in the same script works when getting other tables (like 'ifTable').

So I'm wondering why the command line commands work and the SNMP module doesn't? Does anyone have any ideas why I'm having this problem?

Thanks.

  • Comment on Perl SNMP gettable vs snmptable and snmpbulkget

Replies are listed 'Best First'.
Re: Perl SNMP gettable vs snmptable and snmpbulkget
by atcroft (Abbot) on Jan 14, 2016 at 22:49 UTC

    My first suggestion would be to try using the OID (.1.3.6.1.4.1.9.9.109.1.1.1) in place of the name and see if you can retrieve it in that manner. If so, it may reflect that the module might not have access to/be accessing the same set of MIBs as the other programs you tested.

    Hope that helps.

      Thanks, but that didn't help. I ended up inserting the command line command into my code and just parsing the output. A little more complicated, but it works.