Data Query For Non-Indexed Table

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

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That's correct. People often use Firefox to verify XML ...
Reinhard
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Alright along the lines of this post, I've got a device which doesn't give the Index numbers (like IF-MIB::ifIndex). I've tried using a regex to extract the index numbers from an OID, but obviously not doing something correct.

C:\>snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.1458.100.22.1.2
SNMPv2-SMI::enterprises.1458.100.22.1.2.1 = Gauge32: 0
SNMPv2-SMI::enterprises.1458.100.22.1.2.2 = Gauge32: 0
SNMPv2-SMI::enterprises.1458.100.22.1.2.3 = Gauge32: 0
SNMPv2-SMI::enterprises.1458.100.22.1.2.4 = Gauge32: 0

The very last OID (.1, .2, .3 and .4) are the index numbers I'm trying to extract.

C:\>snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.1458.100.20.1.11
SNMPv2-SMI::enterprises.1458.100.20.1.11.1 = Gauge32: 4

This is the SNMP data query I've got

Code: Select all

   <name>Get AMCC Drive info</name>
   <description>Queries a host for a AMCC Drive info</description>
   <oid_index>.1.3.6.1.4.1.1458.100.22.1.2</oid_index>
   <oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3})$</oid_index_parse>
   <oid_num_indexes>.1.3.6.1.4.1.1458.100.20.1.11</oid_num_indexes>
   <index_order>amccRaidDriveControllerNumber:amccRaidDrivePortNumber:amccRaidDriveSerialNumber</index_order>
   <index_order_type>numeric</index_order_type>
   <index_title_format>|chosen_order_field|</index_title_format>
This is the cacti data query output:
+ Running data query [22].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/amcc_drive.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1458.100.22.1.2'
+ No SNMP data returned
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/amcc_drive.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/amcc_drive.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/snmp_queries/amcc_drive.xml'
Thoughts on what I'm missing?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Not exactly. You already know my HowTo :wink:
I do not recommend using the index_parse, it is not required for a "simple" index. Please strip off all header xml that are not required to ease debugging.
Please start with a single <field>, best bet is the index, using <direction> input and verify from Verbose Query, that the index is found
Reinhard
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Yup, quite familiar with the SNMP Query XML Syntax document ;)

Alright this is the XML I've reduced it to:

Code: Select all

<query>
   <name>Get AMCC Drive info</name>
   <description>Queries a host for a AMCC Drive info</description>
   <oid_index>.1.3.6.1.4.1.1458.100.22.1.2</oid_index>
   <oid_num_indexes>.1.3.6.1.4.1.1458.100.20.1.11</oid_num_indexes>
   <index_order>amccRaidDriveControllerNumber:amccRaidDrivePortNumber</index_order>
   <index_order_type>numeric</index_order_type>
   <index_title_format>|chosen_order_field|</index_title_format>

   <fields>
      <amccRaidDriveIndex>
         <name>Index</name>
         <method>walk</method>
         <source>value</source>
         <direction>input</direction>
         <oid>.1.3.6.1.4.1.1458.100.22.1.2</oid>
      </amccRaidDriveIndex>      
   </fields>
</query>
It still produces the same [empty] output for Verbose query. I tried changing the amccRaidDriveIndex source to <source>OID/REGEXP:.*\.([0-9]+)$</source>, but that too didn't change the output. I also tried source: index, but it too didn't do anything.

I've seen various other posts and bug reports of people trying to do the same thing I am and it eventually works in the end. Of course that was with older cacti versions...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Well, a very annoying feature I lately came across was a device answering to "partly qualified" snmp queries only, failing on fully qualified snmpwalk's or snmpget's. Please verify. Rest seems to be fine, IMHO
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests