Hi guys, need your help!
I've recently started using SNMP queries to gather data. A lot to learn, it's been going well but I have run into a problem.
I have an SNMP table that has 2 indexes (see snmp_index1.PNG) where the index values for each OID are derived from (see snmp_index2.PNG)
I don't know how to create such a data query, that has uses 2 indexes? (see csv export column "F" Indexes (snmp_index3.PNG,)
When i run the query (attached in zip data_query_xml_and_verbose_debug.zip ) I get only 2 rows returned where i should have 4 (again see snmp_index2.PNG).
A verbose query output is attached (attached in zip data_query_xml_and_verbose_debug.zip)
What am I missing? Hoping someone can help!!
Help needed! SNMP table with 2 indexes
Moderators: Developers, Moderators
Help needed! SNMP table with 2 indexes
- Attachments
-
- data_query_xml_and_verbose_debug.zip
- (14.08 KiB) Downloaded 71 times
-
- snmp_index3.PNG (66.72 KiB) Viewed 1669 times
-
- snmp_index2.PNG (6.61 KiB) Viewed 1669 times
-
- snmp_index1.PNG (4.2 KiB) Viewed 1669 times
Re: Help needed! SNMP table with 2 indexes
Cacti doesnt natively work with mutli-valued indexes. there are two hack workarounds.
1) use a regex in the snmp data query which will treat the entire set of values as the index. so in your case they'd be "1.1", "1.2", 2.1", etc.
2) write a php script server script, which will then correctly handle the query/parsing of the mutli valued indexes.
1) use a regex in the snmp data query which will treat the entire set of values as the index. so in your case they'd be "1.1", "1.2", 2.1", etc.
2) write a php script server script, which will then correctly handle the query/parsing of the mutli valued indexes.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re: Help needed! SNMP table with 2 indexes
Thanks for confirming BSOD. I'm struggling to understand the use of OID index parser, do you know of any good resources tha explain how it works?
Re: Help needed! SNMP table with 2 indexes
Figured it out. Well it's working, I might struggle explaining why it works if pressed
Data Query Debug Information
+ Running data query [12].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/html/resource/snmp_queries/xosFlowCounters.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.6848.2.3.26.1.1' Index Count: 3
+ Index found at OID: '1.3.6.1.4.1.6848.2.3.26.1.1.1.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.6848.2.3.26.1.1.2.1' value: '2'
+ Index found at OID: '1.3.6.1.4.1.6848.2.3.26.1.1.3.1' value: '3'
+ index_parse at OID: '1.3.6.1.4.1.6848.2.3.26.1.1.1.1' results: '1.1'
+ index_parse at OID: '1.3.6.1.4.1.6848.2.3.26.1.1.2.1' results: '2.1'
+ index_parse at OID: '1.3.6.1.4.1.6848.2.3.26.1.1.3.1' results: '3.1'
+ Inserting index data for field 'cbsVapIndex' [value='1.1']
+ Inserting index data for field 'cbsVapIndex' [value='2.1']
+ Inserting index data for field 'cbsVapIndex' [value='3.1']
+ Located input field 'cbsVapName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.6848.2.3.26.1.3'
+ Found item [cbsVapName='vsx_1'] index: 1.1 [from value]
+ Found item [cbsVapName='ids_1'] index: 2.1 [from value]
+ Found item [cbsVapName='nofw_1'] index: 3.1 [from value]
XML script
<interface>
<name>Crossbeam XOS Flow Table Counters</name>
<description>Get Crossbeam XOS NPM Current Flow Table Values</description>
<oid_index>.1.3.6.1.4.1.6848.2.3.26.1.1</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]\.[0-9]{1,2})$</oid_index_parse>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<cbsVapIndex>
<name>Index</name>
<source>index</source>
<direction>input</direction>
</cbsVapIndex>
<cbsVapName>
<name>Name</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.6848.2.3.26.1.3</oid>
</cbsVapName>
...
Re: Help needed! SNMP table with 2 indexes
Nicely done you went with the first suggestion solution switch is splitting off the last 2 number groups and handing it to Cacti as the index to use.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Who is online
Users browsing this forum: No registered users and 2 guests