Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun May 27, 2018 2:58 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Can't get SNMP index values with XML query, but snmpwalk can
PostPosted: Fri Oct 07, 2011 2:26 am 
Offline

Joined: Thu Nov 25, 2010 9:15 am
Posts: 41
Location: Latvia, Riga
I have been fighting for some time already, to get this working, but still, with no luck.
It's a "Alvarion Walkair3000 system" with 2933 enterprise ID, that I need to monitor.

SNMPWalk over device index OID .1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1 returns:
Code:
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.66049 = INTEGER: 66049
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.66050 = INTEGER: 66050
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.66051 = INTEGER: 66051
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.66052 = INTEGER: 66052
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.66053 = INTEGER: 66053
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.66054 = INTEGER: 66054
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.66055 = INTEGER: 66055
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.131585 = INTEGER: 131585
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.131586 = INTEGER: 131586
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.131587 = INTEGER: 131587
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.131588 = INTEGER: 131588
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.131589 = INTEGER: 131589
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.131590 = INTEGER: 131590
.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1.131591 = INTEGER: 131591

But when I use XML:
Code:
      <oid_index>.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1</oid_index>
      <index_order>apmCurrentDeviceIndex</index_order>
      <index_order_type>alphabetic</index_order_type>
      <fields>
         <apmCurrentDeviceIndex>
            <name>Current Device Index</name>
            <source>index</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1</oid>
         </apmCurrentDeviceIndex>
      </fields>

Or even with regex
Code:
      <oid_index_parse>OID/REGEXP:^.*\.2933(?:\.\d{1,3}){8}\.(\d{5,6})$</oid_index_parse>
      <index_order>apmCurrentDeviceIndex</index_order>
      <index_order_type>alphabetic</index_order_type>
      <fields>
         <apmCurrentDeviceIndex>
            <name>Current Device Index</name>
            <source>index</source>
            <direction>input</direction>
         </apmCurrentDeviceIndex>
      </fields>

Data Query Debug Information @ Cacti outputs:
Code:
+ Running data query [10].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/usr/local/www/apache22/data/cactiBeta/resource/snmp_queries/alvarion_walkair.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1' Index Count: 0
+ No SNMP data returned


My Cacti Version 0.8.7h and
Attachment:
File comment: My Cacti technical data (zipped HTML file with <table>)
cacti-technical-data.zip [9.79 KiB]
Downloaded 524 times


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Fri Oct 07, 2011 6:26 pm 
Offline
Cacti User
User avatar

Joined: Thu Nov 12, 2009 3:07 pm
Posts: 109
Deele wrote:
But when I use XML:
Code:
      <oid_index>.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1</oid_index>
      <index_order>apmCurrentDeviceIndex</index_order>
      <index_order_type>alphabetic</index_order_type>
      <fields>
         <apmCurrentDeviceIndex>
            <name>Current Device Index</name>
            <source>index</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1</oid>
         </apmCurrentDeviceIndex>
      </fields>


Data Query Debug Information @ Cacti outputs:
Code:
+ Running data query [10].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/usr/local/www/apache22/data/cactiBeta/resource/snmp_queries/alvarion_walkair.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2933.1.2.17.1.1.1.1.1' Index Count: 0
+ No SNMP data returned





I think the error message is pretty self explanatory. You need to add <oid_num_indexes> in your xml file.

like this example:

Code:
<interface>
   <name>Get SNMP Interfaces</name>
   <description>Queries a host for a list of monitorable interfaces</description>
   <oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
   <oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>

   <fields>
      <ifIndex>
         <name>Index</name>
         <method>walk</method>
         <source>value</source>
         <direction>input</direction>
         <oid>.1.3.6.1.2.1.2.2.1.1</oid>
      </ifIndex>
   </fields>
</interface>


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Fri Oct 07, 2011 7:48 pm 
Offline

Joined: Thu Nov 25, 2010 9:15 am
Posts: 41
Location: Latvia, Riga
classen wrote:
I think the error message is pretty self explanatory. You need to add <oid_num_indexes> in your xml file.

Thats not an error, thats warning with notice 'Index Count Changed' emulated by counting oid_index entries
oid_num_indexes is optional field, as said in all documents as most devices doesn't have such value.
Any way, I tried it, and got same result. I found one OID for that device, with integer value of 14. That time, only difference was, it used snmpget for oid_num_indexes OID, and got value 14, showed it - the next snmpwalk for indexes, returned 0.


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Sun Oct 23, 2011 12:34 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
The warning is indeed a warning only; there's no need to change that.
But I'm wondering why the sweep over the index does not return sensible data. May you please provide us with the snmpwalk statement that you've used on cli? Did you select specific snmp options for that?
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Sun Oct 23, 2011 12:49 pm 
Offline

Joined: Thu Nov 25, 2010 9:15 am
Posts: 41
Location: Latvia, Riga
No specific options, just for this case, I used -On output option to show numberic output. Without it, it would be:
Code:
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.66049 = INTEGER: 66049
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.66050 = INTEGER: 66050
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.66051 = INTEGER: 66051
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.66052 = INTEGER: 66052
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.66053 = INTEGER: 66053
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.66054 = INTEGER: 66054
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.66055 = INTEGER: 66055
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.131585 = INTEGER: 131585
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.131586 = INTEGER: 131586
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.131587 = INTEGER: 131587
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.131588 = INTEGER: 131588
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.131589 = INTEGER: 131589
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.131590 = INTEGER: 131590
SNMPv2-SMI::enterprises.2933.1.2.17.1.1.1.1.1.131591 = INTEGER: 131591


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Sun Oct 23, 2011 1:45 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Can you do a wireshark trace while running a "Verbose Query"?
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Sun Jan 01, 2012 4:45 am 
Offline

Joined: Fri Dec 23, 2011 4:39 am
Posts: 5
I am experiencing the same problem with 0.8.7i/spine

+ Executing SNMP get for num of indexes @ '.1.3.6.1.4.1.2636.3.2.1.3.0' Index Count: 86
+ Debug: cacti_snmp_walk(x.x.x.x,public,.1.3.6.1.4.1.2636.3.2.3.1.1,2) - sizeof(snmp_indexes)=0 (I added this to check)
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2636.3.2.3.1.1' Index Count: 0

I have compared packet captures from a 'verbose query' and manually from the CLI. The bulkget cacti requests has max-repetitions set to 20 but the device does not respond when it is above 17

~$ snmpbulkget -c public -v2c -Cr17 x.x.x.x .1.3.6.1.4.1.2636.3.2.3.1.1
MPLS-MIB::mplsLspName.'test1...........................' = STRING: test1
MPLS-MIB::mplsLspName.'test2...........................' = STRING: test2
MPLS-MIB::mplsLspName.'test3...........................' = STRING: test3
MPLS-MIB::mplsLspName.'test4...........................' = STRING: test4
MPLS-MIB::mplsLspName.'test5...........................' = STRING: test5
MPLS-MIB::mplsLspName.'test6...........................' = STRING: test6
MPLS-MIB::mplsLspName.'test7...........................' = STRING: test7
MPLS-MIB::mplsLspName.'test8...........................' = STRING: test8
MPLS-MIB::mplsLspName.'test9...........................' = STRING: test9
MPLS-MIB::mplsLspName.'test10..........................' = STRING: test10
MPLS-MIB::mplsLspName.'test11..........................' = STRING: test11
MPLS-MIB::mplsLspName.'test12..........................' = STRING: test12
MPLS-MIB::mplsLspName.'test13..........................' = STRING: test13
MPLS-MIB::mplsLspName.'test14..........................' = STRING: test14
MPLS-MIB::mplsLspName.'test15..........................' = STRING: test15
MPLS-MIB::mplsLspName.'test16..........................' = STRING: test16
MPLS-MIB::mplsLspName.'test17..........................' = STRING: test17
~$ snmpbulkget -c public -v2c -Cr18 x.x.x.x .1.3.6.1.4.1.2636.3.2.3.1.1
Timeout: No Response from x.x.x.x
~$ snmpbulkget -c public -v2c -Cr20 x.x.x.x .1.3.6.1.4.1.2636.3.2.3.1.1
Timeout: No Response from x.x.x.x
~$

max oid is set to 10 under the device and within the poller settings, so I am not sure if it is possible to change this value.

Thanks
tjh


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Sun Jan 01, 2012 4:29 pm 
Offline

Joined: Fri Dec 23, 2011 4:39 am
Posts: 5
I have resolved my problem.

snmp.c in php5-snmp has max-repetition hard coded to 20.

pdu->max_repetitions = 20;

I decreased this to 15 and recompiled php5-snmp, restarted apache and the snmp queries now work within cacti.

Juniper MX80 and RE2000 (MX240/480/960) as at JunOS 11.X. The Juniper routers do no respond if the max-rep is above 17.

tjh


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Fri Nov 02, 2012 10:22 am 
Offline

Joined: Tue Apr 04, 2006 8:19 am
Posts: 27
snmp.c in php5-snmp has max-repetition hard coded to 20.

pdu->max_repetitions = 20;

I decreased this to 15 and recompiled php5-snmp, restarted apache and the snmp queries now work within cacti.

Juniper MX80 and RE2000 (MX240/480/960) as at JunOS 11.X. The Juniper routers do no respond if the max-rep is above 17.


Where did you find this file? I am hitting the same issues with Junos 12.2.


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Sat Nov 10, 2012 2:10 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
tjh wrote:
I have resolved my problem.

snmp.c in php5-snmp has max-repetition hard coded to 20.

pdu->max_repetitions = 20;

I decreased this to 15 and recompiled php5-snmp, restarted apache and the snmp queries now work within cacti.

Juniper MX80 and RE2000 (MX240/480/960) as at JunOS 11.X. The Juniper routers do no respond if the max-rep is above 17.

tjh
Wow, I just stumbled across the same issue. php-snmp unconditionally uses bulkwalk. You can't cahnge neither max-rep nor refrain from using bulkwalk. Only way to do this from "outside" is to use snmp version 1 instead of version 2. But this may have other drawbacks
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Fri Aug 16, 2013 8:22 am 
Offline

Joined: Sat Mar 17, 2012 2:15 pm
Posts: 2
Hi All,

I am also facing the same issue for juniper m120 qos and TE tunnel template.

i also tried to check snmp.c in php5-snmp but there is no max-repetition hard coded to 20.

I am using UBUNTU.

Kindly help me to resolve this issue.



Running data query [21].
+ Found type = '4' [Script Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/juniper_intcos.xml'
+ XML file parsed ok.
+ <arg_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting arg_index entries
+ Executing script for list of indexes 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea index' Index Count: 0
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query index'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query desc'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query ifname'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query ifalias'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query iftype'


Top
 Profile  
 
 Post subject: Re: Can't get SNMP index values with XML query, but snmpwalk
PostPosted: Wed Nov 25, 2015 5:42 am 
Offline

Joined: Wed Nov 25, 2015 5:39 am
Posts: 3
sushantwinner wrote:
Hi All,

I am also facing the same issue for juniper m120 qos and TE tunnel template.

i also tried to check snmp.c in php5-snmp but there is no max-repetition hard coded to 20.

I am using UBUNTU.

Kindly help me to resolve this issue.



Running data query [21].
+ Found type = '4' [Script Query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/juniper_intcos.xml'
+ XML file parsed ok.
+ <arg_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting arg_index entries
+ Executing script for list of indexes 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea index' Index Count: 0
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query index'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query desc'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query ifname'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query ifalias'
+ Executing script query 'perl /usr/share/cacti/site/scripts/junipercos.pl 10.160.4.226 idea query iftype'


I has similar error until i changed Data Input Metod in Data Template, it was "Get Scrip Data", i changed it to "Get SNMP Data".


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 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