Help creating XML query

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

Moderators: Developers, Moderators

Post Reply
dougm
Posts: 5
Joined: Fri Sep 22, 2006 11:25 am
Location: Indiana USA

Help creating XML query

Post by dougm »

I'm pretty new at this and the forum is pretty cluttered so please forgive me if this question has been asked 1000 times already.

I am trying to create a simple XML query so I can graph the Dot11Radio associations on a Cisco AP. YES I already searched the forum and there is already a thread about graphing the associations, but it's a single OID only (non-indexed). This only presents half the information when your company is using both 802.11a AND 802.11g radios.

I tried using this XML...

Code: Select all

<interface>
   <name>Get dot11associations</name>
   <description>Get SNMP based Association information from Cisco AP1200</description>
   <index_order_type>numeric</index_order_type>
   <oid_index>.1.3.6.1.4.1.9.9.273.1.1.2.1.1</oid_index>

   <fields>
      <dot11Radio0assoc>
         <name>Dot11Radio0 Associations</name>
         <method>walk</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.9.9.273.1.1.2.1.1.1</oid>
      </dot11Radio0assoc>
      <dot11Radio1assoc>
         <name>Dot11Radio1 Associations</name>
         <method>walk</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.9.9.273.1.1.2.1.1.2</oid>
      </dot11Radio1assoc>
   </fields>
</interface>
...but when I added the Data Query 0 items and 0 rows were returned.

This is the snmpwalk of the device index I am trying to graph:

Code: Select all

dougm@cacti:~> snmpwalk -v 2c -c <community> 10.13.x.x .1.3.6.1.4.1.9.9.273.1.1.2.1.1
SNMPv2-SMI::enterprises.9.9.273.1.1.2.1.1.1 = Gauge32: 3
SNMPv2-SMI::enterprises.9.9.273.1.1.2.1.1.2 = Gauge32: 1
The two OID's I want to put on one graph are:

.1.3.6.1.4.1.9.9.273.1.1.2.1.1.1 Dot11Radio0 (802.11g) Association Count
.1.3.6.1.4.1.9.9.273.1.1.2.1.1.2 Dot11Radio1 (802.11a) Association Count


These OIDs are the same on all of our Cisco AP devices. They show the number of wireless users associated with each radio. Can someone tell me what I'm doing wrong. Thanks!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There is a little howto to be found in the last link of my signature. Please try if
Reinhard
dougm
Posts: 5
Joined: Fri Sep 22, 2006 11:25 am
Location: Indiana USA

Post by dougm »

I actually followed your steps exactly but was still getting the 0 items and 0 rows returned even though an snmpwalk produces actual numbers. It seems like a simple problem with my XML layout. What gives?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Help creating XML query

Post by gandalf »

Had a look at your XML. Unfortunately, you mentioned already both items you want to get per your SNMP Query. Please reform your xml to read

Code: Select all

<interface>
   <name>Get dot11associations</name>
   <description>Get SNMP based Association information from Cisco AP1200</description>
   <index_order_type>numeric</index_order_type>
   <oid_index>.1.3.6.1.4.1.9.9.273.1.1.2.1.1</oid_index>

   <fields>
      <dot11RadioAssoc>
         <name>Dot11Radio Associations</name>
         <method>walk</method>
         <source>value</source>
         <direction>output</direction>
         <oid>.1.3.6.1.4.1.9.9.273.1.1.2.1.1</oid>
      </dot11RadioAssoc>
   </fields>
</interface>
This query should get you two indices
Reinhard
dougm
Posts: 5
Joined: Fri Sep 22, 2006 11:25 am
Location: Indiana USA

Post by dougm »

I modified my XML with what you provided I'm still getting 0 rows and 0 items. Here is what the debug returned:

Code: Select all

+ Running data query [13].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/aironet_assoc.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9.9.273.1.1.2.1.1'
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/aironet_assoc.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/aironet_assoc.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/aironet_assoc.xml'
I'm so confused and frustrated at the same time. How could something so simple as two OIDs be this complicated to plot on a graph? Why do I even have to fuss with these index things? Why do I need an index in order to plot two points on a graph???? The snmpwalk clearly shows values in the respective OIDs. :cry:
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Sorry for confusing you. And I really made a mistake with the XML, the "index" is missing. This would be the OID that numbers all occurences (2 in your example). It would be possible to add this. But currently I don't have access to my test system, so I can't verify. You may check the documentation on SNMP Data Queries if you want to get it on your own.
And, yes, XML Data Queries are a bit tricky for the first time. But in your case, two copies of the "generic OID Template" would do, of course.
For more stuff on SNMP Data Queries, see again last link of my signature
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests