Help with data query

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
abellanger
Posts: 1
Joined: Tue Dec 15, 2009 10:49 am

Help with data query

Post by abellanger »

My apologies for the long post, but I’m trying to be as complete as possible. I’m fairly new to Cacti, and this is my first foray into creating a custom data query, so please excuse my ignorance. I’ve been at this for quite a while and feel close, but frustrated.

I have an two indexless oids that I’d like to gather data from.

....29.<index> is one of the sets of data I’m looking to collect.
....25.<index> is another.
Here is a walk of the two oids:

Code: Select all

root@dcn-babbage:/ # snmpwalk -v1 -c public <IP> .1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.18 = INTEGER: 0
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.19 = INTEGER: 2
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.20 = INTEGER: 1
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.21 = INTEGER: 0
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.22 = INTEGER: 4
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.23 = INTEGER: 0
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.24 = INTEGER: 3
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.25 = INTEGER: 0
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.140 = INTEGER: 7
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.141 = INTEGER: 0
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.313 = INTEGER: 3
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.314 = INTEGER: 0
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.315 = INTEGER: 5
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.316 = INTEGER: 6
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.317 = INTEGER: 1
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.318 = INTEGER: 2
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.319 = INTEGER: 4
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.320 = INTEGER: 1
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.321 = INTEGER: 0
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.29.322 = INTEGER: 9
root@dcn-babbage:/ # snmpwalk -v1 -c public <IP> .1.3.6.1.4.1.1429.5.1.11.2.3.1.1.25
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.18 = INTEGER: 764
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.19 = INTEGER: 840
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.20 = INTEGER: 644
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.21 = INTEGER: 627
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.22 = INTEGER: 949
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.23 = INTEGER: 824
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.24 = INTEGER: 371
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.25 = INTEGER: 854
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.140 = INTEGER: 582
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.141 = INTEGER: 775
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.313 = INTEGER: 689
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.314 = INTEGER: 713
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.315 = INTEGER: 940
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.316 = INTEGER: 693
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.317 = INTEGER: 700
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.318 = INTEGER: 436
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.319 = INTEGER: 582
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.320 = INTEGER: 581
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.321 = INTEGER: 595
SNMPv2-SMI::enterprises.1429.5.1.11.2.3.1.1.25.322 = INTEGER: 745
Here is what I have for the xml. I don’t need a name for each index – the index number has meaning to me.
Problems: When I load the data query, it ignores the two output fields. Interestingly, it picks them up when they’re specified as input instead.

Code: Select all

<interface>
        <name>USRM SG Utilization</name>
        <description>USRM SG Utilization</description>
        <oid_index>.1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29</oid_index>
        <oid_index_parse>OID/REGEXP:.*\.([0-9]{2,3})$</oid_index_parse>
        <index_order>Index</index_order>
        <index_order_type>alphabetic</index_order_type>

        <fields>

                <SGIndex>
                       <name>SGIndex</name>
                       <source>index</source>
                       <direction>input</direction>
                </SGIndex>

                <ChanCount>
                        <name>Chans</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29</oid>
                </ChanCount>

                <STBCount>
                        <name>STBs</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.1429.5.1.11.2.3.1.1.25</oid>
                </STBCount>

        </fields>
</interface>
Here is the debug for the data query. You can see the it correctly parses the indexes, however it seems to ignore the two output fields and I can’t figure out why. As I said earlier, if I change them to input, it picks them up with the correct values, but I intend to be graphing them.

Code: Select all

+ Running data query [13].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/opt/coolstack/apache2/htdocs/cacti/resource/snmp_queries/usrmquery.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.18' value: '0'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.19' value: '2'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.20' value: '1'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.21' value: '0'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.22' value: '4'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.23' value: '0'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.24' value: '3'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.25' value: '0'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.140' value: '7'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.141' value: '0'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.313' value: '3'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.314' value: '0'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.315' value: '5'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.316' value: '6'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.317' value: '1'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.318' value: '2'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.319' value: '4'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.320' value: '1'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.321' value: '0'
+ Index found at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.322' value: '9'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.18' results: '18'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.19' results: '19'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.20' results: '20'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.21' results: '21'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.22' results: '22'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.23' results: '23'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.24' results: '24'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.25' results: '25'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.140' results: '140'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.141' results: '141'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.313' results: '313'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.314' results: '314'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.315' results: '315'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.316' results: '316'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.317' results: '317'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.318' results: '318'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.319' results: '319'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.320' results: '320'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.321' results: '321'
+ index_parse at OID: '1.3.6.1.4.1.1429.5.1.11.2.3.1.1.29.322' results: '322'
+ Inserting index data for field 'SGIndex' [value='18']
+ Inserting index data for field 'SGIndex' [value='19']
+ Inserting index data for field 'SGIndex' [value='20']
+ Inserting index data for field 'SGIndex' [value='21']
+ Inserting index data for field 'SGIndex' [value='22']
+ Inserting index data for field 'SGIndex' [value='23']
+ Inserting index data for field 'SGIndex' [value='24']
+ Inserting index data for field 'SGIndex' [value='25']
+ Inserting index data for field 'SGIndex' [value='140']
+ Inserting index data for field 'SGIndex' [value='141']
+ Inserting index data for field 'SGIndex' [value='313']
+ Inserting index data for field 'SGIndex' [value='314']
+ Inserting index data for field 'SGIndex' [value='315']
+ Inserting index data for field 'SGIndex' [value='316']
+ Inserting index data for field 'SGIndex' [value='317']
+ Inserting index data for field 'SGIndex' [value='318']
+ Inserting index data for field 'SGIndex' [value='319']
+ Inserting index data for field 'SGIndex' [value='320']
+ Inserting index data for field 'SGIndex' [value='321']
+ Inserting index data for field 'SGIndex' [value='322']
+ Found data query XML file at '/opt/coolstack/apache2/htdocs/cacti/resource/snmp_queries/usrmquery.xml'
+ Found data query XML file at '/opt/coolstack/apache2/htdocs/cacti/resource/snmp_queries/usrmquery.xml'
+ Found data query XML file at '/opt/coolstack/apache2/htdocs/cacti/resource/snmp_queries/usrmquery.xml'
[/code]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The Regexp is wrong. It should catch the last two OID tupels.
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest