cacti_snmp_walk and get missing results

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
dsmhood
Posts: 2
Joined: Thu May 05, 2011 8:10 pm

cacti_snmp_walk and get missing results

#1 Post by dsmhood » Tue Aug 25, 2015 5:27 pm

When I do a snmpwalk, I get the following results:

Code: Select all

[[email protected] cacti]# snmpwalk -v 2c -c public 10.1.1.1 .1.3.6.1.4        

SNMPv2-SMI::enterprises.9.2.1.1.0 = STRING: "
Bootstrap program is Alpha board boot loader
"
SNMPv2-SMI::enterprises.9.2.1.2.0 = STRING: "power-on"
SNMPv2-SMI::enterprises.9.2.1.3.0 = STRING: "switch01"
SNMPv2-SMI::enterprises.9.2.1.4.0 = STRING: "power.com"
SNMPv2-SMI::enterprises.9.2.1.5.0 = IpAddress: 10.1.66.212
SNMPv2-SMI::enterprises.9.2.1.6.0 = IpAddress: 0.0.0.0
SNMPv2-SMI::enterprises.9.2.1.8.0 = INTEGER: 46711724
SNMPv2-SMI::enterprises.9.2.1.9.0 = INTEGER: 1071
SNMPv2-SMI::enterprises.9.2.1.10.0 = INTEGER: 500
SNMPv2-SMI::enterprises.9.2.1.11.0 = INTEGER: 869404313
SNMPv2-SMI::enterprises.9.2.1.12.0 = INTEGER: 0
SNMPv2-SMI::enterprises.9.2.1.13.0 = INTEGER: 1024
SNMPv2-SMI::enterprises.9.2.1.14.0 = INTEGER: 104
SNMPv2-SMI::enterprises.9.2.1.15.0 = INTEGER: 50
SNMPv2-SMI::enterprises.9.2.1.16.0 = INTEGER: 49
SNMPv2-SMI::enterprises.9.2.1.17.0 = INTEGER: 150
SNMPv2-SMI::enterprises.9.2.1.18.0 = INTEGER: 430780518
SNMPv2-SMI::enterprises.9.2.1.19.0 = INTEGER: 24
SNMPv2-SMI::enterprises.9.2.1.20.0 = INTEGER: 72
SNMPv2-SMI::enterprises.9.2.1.21.0 = INTEGER: 72
SNMPv2-SMI::enterprises.9.2.1.22.0 = INTEGER: 600
SNMPv2-SMI::enterprises.9.2.1.23.0 = INTEGER: 25
SNMPv2-SMI::enterprises.9.2.1.24.0 = INTEGER: 25
SNMPv2-SMI::enterprises.9.2.1.25.0 = INTEGER: 150
SNMPv2-SMI::enterprises.9.2.1.26.0 = INTEGER: 1258128
SNMPv2-SMI::enterprises.9.2.1.27.0 = INTEGER: 275
SNMPv2-SMI::enterprises.9.2.1.28.0 = INTEGER: 825
SNMPv2-SMI::enterprises.9.2.1.29.0 = INTEGER: 825
The results I'm looking to get are here:

Code: Select all

[[email protected] cacti]# snmpget -v 2c -c public 10.1.1.1 1.3.6.1.4.1.9.9.189.1.3.2.1.7.10701.1.1
SNMPv2-SMI::enterprises.9.9.189.1.3.2.1.7.10701.1.1 = Counter64: 0
[[email protected] cacti]# snmpget -v 2c -c public 10.1.1.1 1.3.6.1.4.1.9.9.189.1.3.2.1.7.10701.2.1
SNMPv2-SMI::enterprises.9.9.189.1.3.2.1.7.10701.2.1 = Counter64: 0
[[email protected]1 cacti]#
So they definitely exist. But when I run the following code, this is the output I'm getting:

Code: Select all

[[email protected] cacti]# php -q scripts/query_qos.php 10.1.1.1 public 1 161 500 "" "" "" "" "" "" "" query qosQ1Drops
First Test:GigabitEthernet1/0/1
Second Test:0
Third test:
[[email protected] cacti]#
Here is the relevant pieces of code:

Code: Select all

}elseif ($cmd == "query" && $query_field == "qosQ1Drops") {

  $request_oid = ".1.3.6.1.2.1.2.2.1.2.10101";

  print "First Test:";
  print(cacti_snmp_get($hostname, $snmp_community, $request_oid, $snmp_version,$snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol , $snmp_context ,$snmp_port, $snmp_timeout, $snmp_retries, $max_oids, SNMP_POLLER));

   $request_oid = ".1.3.6.1.4";

   print "\nSecond Test:";
   $arr = reindex(cacti_snmp_walk($hostname, $snmp_community,
   $request_oid, $snmp_version, $snmp_auth_username,
   $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol,
   $snmp_context, $snmp_port, $snmp_timeout, $snmp_retries, $max_oids, SNMP_POLLER));

   print(sizeof($arr));

   for ($i=0;($i<sizeof($arr));$i++) {
      print  $arr[$i] . "\n";
   }


   print "\nThird test:\n";

   print(cacti_snmp_get($hostname, $snmp_community, $request_oid, $snmp_version,$snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol , $snmp_context ,$snmp_port, $snmp_timeout, $snmp_retries, $max_oids, SNMP_POLLER));
Why am I getting no results returned? I can see that SNMP is returning for some OIDs, but it's just missing completely for others.

Post Reply