Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jun 18, 2019 12:42 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: cacti_snmp_walk and get missing results
PostPosted: Tue Aug 25, 2015 5:27 pm 
Offline

Joined: Thu May 05, 2011 8:10 pm
Posts: 2
When I do a snmpwalk, I get the following results:

Code:
[[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:
[[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] cacti]#


So they definitely exist. But when I run the following code, this is the output I'm getting:

Code:
[[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:
}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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group