oid_suffix does not appear to work

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

Moderators: Developers, Moderators

Post Reply
acvolt
Posts: 14
Joined: Thu Apr 28, 2005 11:48 am

oid_suffix does not appear to work

Post by acvolt »

I'm trying to create a custom snmp data query to pull values from a vendor specific mib, but I need to add a suffix onto certain entries.

The index to this MIB has 3 values and I use the following to get the index:
<oid_index>.1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]*\.[0-9]*\.[0-9]*)$</oid_index_parse>

This part works. All of the entries that do not require a trailing suffix work correctly.
The problem is I have a set of outputs from the query that do not seem to work. Below is one of the non-working output fields.
<IOH1>
<name>IOH1</name>
<method>get</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4</oid>
<oid_suffix>1</oid_suffix>
</IOH1>

For debugging purposes I changed the direction to input and it does not apply the suffix. When I try to create graphs with this the RRD file never gets created, The OID never shows up in either the poller cache or SNMP cache. I even set the log level to results and nothing shows up there. Manually doing a snmpget with the OID listed above with the index as Cacti sees it(from the debug output) and the suffix of 1 returns the correct value.


What should I try next?

Cacti Version: 0.8.7e with all patches applied. PIA 2.5, Boost 2.5, RRDTOOL 1.3.1-4, PHP 5.2.6, MYSQL 5.0.51
BorisL
Cacti User
Posts: 131
Joined: Sat Mar 31, 2007 9:21 am
Contact:

Post by BorisL »

Turn problem field into direction=input and show verbose query for you XML.
acvolt
Posts: 14
Joined: Thu Apr 28, 2005 11:48 am

Post by acvolt »

Here is the verbose query debug output. The fields I am interested in are at the bottom under "svcQ1_IOH".

+ Running data query [24].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/rtr_interface.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.1.69271552.0' value: '69271552'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.4.69238784.0' value: '69238784'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.9.69435392.100' value: '69435392'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.12.35946496.0' value: '35946496'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.14.1342177281.268372230' value: '1342177281'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.41.69304320.4095' value: '69304320'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.42.1342177281.268372244' value: '1342177281'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.42.1342177281.268372343' value: '1342177281'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.50.639664197.0' value: '639664197'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.52.639664249.0' value: '639664249'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.101.69337088.0' value: '69337088'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.102.35782656.4095' value: '35782656'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.200.1342177281.268371020' value: '1342177281'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.666.35815424.101' value: '35815424'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.6666.35815424.102' value: '35815424'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.6667.35815424.202' value: '35815424'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.314159.35782656.4000' value: '35782656'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.314159.35782656.4001' value: '35782656'
+ Index found at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.314159.35782656.4002' value: '35782656'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.1.69271552.0' results: '1.69271552.0'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.4.69238784.0' results: '4.69238784.0'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.9.69435392.100' results: '9.69435392.100'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.12.35946496.0' results: '12.35946496.0'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.14.1342177281.268372230' results: '14.1342177281.268372230'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.41.69304320.4095' results: '41.69304320.4095'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.42.1342177281.268372244' results: '42.1342177281.268372244'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.42.1342177281.268372343' results: '42.1342177281.268372343'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.50.639664197.0' results: '50.639664197.0'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.52.639664249.0' results: '52.639664249.0'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.101.69337088.0' results: '101.69337088.0'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.102.35782656.4095' results: '102.35782656.4095'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.200.1342177281.268371020' results: '200.1342177281.268371020'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.666.35815424.101' results: '666.35815424.101'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.6666.35815424.102' results: '6666.35815424.102'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.6667.35815424.202' results: '6667.35815424.202'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.314159.35782656.4000' results: '314159.35782656.4000'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.314159.35782656.4001' results: '314159.35782656.4001'
+ index_parse at OID: '1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1.314159.35782656.4002' results: '314159.35782656.4002'
+ Inserting index data for field 'svcIndex' [value='1.69271552.0']
+ Inserting index data for field 'svcIndex' [value='4.69238784.0']
+ Inserting index data for field 'svcIndex' [value='9.69435392.100']
+ Inserting index data for field 'svcIndex' [value='12.35946496.0']
+ Inserting index data for field 'svcIndex' [value='14.1342177281.268372230']
+ Inserting index data for field 'svcIndex' [value='41.69304320.4095']
+ Inserting index data for field 'svcIndex' [value='42.1342177281.268372244']
+ Inserting index data for field 'svcIndex' [value='42.1342177281.268372343']
+ Inserting index data for field 'svcIndex' [value='50.639664197.0']
+ Inserting index data for field 'svcIndex' [value='52.639664249.0']
+ Inserting index data for field 'svcIndex' [value='101.69337088.0']
+ Inserting index data for field 'svcIndex' [value='102.35782656.4095']
+ Inserting index data for field 'svcIndex' [value='200.1342177281.268371020']
+ Inserting index data for field 'svcIndex' [value='666.35815424.101']
+ Inserting index data for field 'svcIndex' [value='6666.35815424.102']
+ Inserting index data for field 'svcIndex' [value='6667.35815424.202']
+ Inserting index data for field 'svcIndex' [value='314159.35782656.4000']
+ Inserting index data for field 'svcIndex' [value='314159.35782656.4001']
+ Inserting index data for field 'svcIndex' [value='314159.35782656.4002']
+ Located input field 'svcOperStatus' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.2.1.7'
+ Found item [svcOperStatus='2'] index: 1.69271552.0 [from value]
+ Found item [svcOperStatus='1'] index: 4.69238784.0 [from value]
+ Found item [svcOperStatus='2'] index: 9.69435392.100 [from value]
+ Found item [svcOperStatus='2'] index: 12.35946496.0 [from value]
+ Found item [svcOperStatus='1'] index: 14.1342177281.268372230 [from value]
+ Found item [svcOperStatus='2'] index: 41.69304320.4095 [from value]
+ Found item [svcOperStatus='1'] index: 42.1342177281.268372244 [from value]
+ Found item [svcOperStatus='1'] index: 42.1342177281.268372343 [from value]
+ Found item [svcOperStatus='1'] index: 50.639664197.0 [from value]
+ Found item [svcOperStatus='2'] index: 52.639664249.0 [from value]
+ Found item [svcOperStatus='2'] index: 101.69337088.0 [from value]
+ Found item [svcOperStatus='2'] index: 102.35782656.4095 [from value]
+ Found item [svcOperStatus='1'] index: 200.1342177281.268371020 [from value]
+ Found item [svcOperStatus='1'] index: 666.35815424.101 [from value]
+ Found item [svcOperStatus='1'] index: 6666.35815424.102 [from value]
+ Found item [svcOperStatus='1'] index: 6667.35815424.202 [from value]
+ Found item [svcOperStatus='2'] index: 314159.35782656.4000 [from value]
+ Found item [svcOperStatus='2'] index: 314159.35782656.4001 [from value]
+ Found item [svcOperStatus='2'] index: 314159.35782656.4002 [from value]
+ Located input field 'svcDescr' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.2.1.5'
+ Found item [svcDescr=''] index: 1.69271552.0 [from value]
+ Found item [svcDescr=''] index: 4.69238784.0 [from value]
+ Found item [svcDescr=''] index: 9.69435392.100 [from value]
+ Found item [svcDescr=''] index: 12.35946496.0 [from value]
+ Found item [svcDescr=''] index: 14.1342177281.268372230 [from value]
+ Found item [svcDescr=''] index: 41.69304320.4095 [from value]
+ Found item [svcDescr=''] index: 42.1342177281.268372244 [from value]
+ Found item [svcDescr=''] index: 42.1342177281.268372343 [from value]
+ Found item [svcDescr=''] index: 50.639664197.0 [from value]
+ Found item [svcDescr=''] index: 52.639664249.0 [from value]
+ Found item [svcDescr=''] index: 101.69337088.0 [from value]
+ Found item [svcDescr=''] index: 102.35782656.4095 [from value]
+ Found item [svcDescr=''] index: 200.1342177281.268371020 [from value]
+ Found item [svcDescr=''] index: 666.35815424.101 [from value]
+ Found item [svcDescr=''] index: 6666.35815424.102 [from value]
+ Found item [svcDescr=''] index: 6667.35815424.202 [from value]
+ Found item [svcDescr='svc4ktest'] index: 314159.35782656.4000 [from value]
+ Found item [svcDescr='svc4k1-test'] index: 314159.35782656.4001 [from value]
+ Found item [svcDescr='svc4k2-testasdf'] index: 314159.35782656.4002 [from value]
+ Located input field 'svcSvc' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.2.1.1'
+ Found item [svcSvc='1'] index: 1.69271552.0 [from regexp oid parse]
+ Found item [svcSvc='4'] index: 4.69238784.0 [from regexp oid parse]
+ Found item [svcSvc='9'] index: 9.69435392.100 [from regexp oid parse]
+ Found item [svcSvc='12'] index: 12.35946496.0 [from regexp oid parse]
+ Found item [svcSvc='14'] index: 14.1342177281.268372230 [from regexp oid parse]
+ Found item [svcSvc='41'] index: 41.69304320.4095 [from regexp oid parse]
+ Found item [svcSvc='42'] index: 42.1342177281.268372244 [from regexp oid parse]
+ Found item [svcSvc='42'] index: 42.1342177281.268372343 [from regexp oid parse]
+ Found item [svcSvc='50'] index: 50.639664197.0 [from regexp oid parse]
+ Found item [svcSvc='52'] index: 52.639664249.0 [from regexp oid parse]
+ Found item [svcSvc='101'] index: 101.69337088.0 [from regexp oid parse]
+ Found item [svcSvc='102'] index: 102.35782656.4095 [from regexp oid parse]
+ Found item [svcSvc='200'] index: 200.1342177281.268371020 [from regexp oid parse]
+ Found item [svcSvc='666'] index: 666.35815424.101 [from regexp oid parse]
+ Found item [svcSvc='6666'] index: 6666.35815424.102 [from regexp oid parse]
+ Found item [svcSvc='6667'] index: 6667.35815424.202 [from regexp oid parse]
+ Found item [svcSvc='314159'] index: 314159.35782656.4000 [from regexp oid parse]
+ Found item [svcSvc='314159'] index: 314159.35782656.4001 [from regexp oid parse]
+ Found item [svcSvc='314159'] index: 314159.35782656.4002 [from regexp oid parse]
+ Located input field 'svcType' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.2.1.4'
+ Found item [svcType='6'] index: 1.69271552.0 [from value]
+ Found item [svcType='5'] index: 4.69238784.0 [from value]
+ Found item [svcType='1'] index: 9.69435392.100 [from value]
+ Found item [svcType='5'] index: 12.35946496.0 [from value]
+ Found item [svcType='5'] index: 14.1342177281.268372230 [from value]
+ Found item [svcType='1'] index: 41.69304320.4095 [from value]
+ Found item [svcType='3'] index: 42.1342177281.268372244 [from value]
+ Found item [svcType='3'] index: 42.1342177281.268372343 [from value]
+ Found item [svcType='10'] index: 50.639664197.0 [from value]
+ Found item [svcType='10'] index: 52.639664249.0 [from value]
+ Found item [svcType='3'] index: 101.69337088.0 [from value]
+ Found item [svcType='1'] index: 102.35782656.4095 [from value]
+ Found item [svcType='1'] index: 200.1342177281.268371020 [from value]
+ Found item [svcType='5'] index: 666.35815424.101 [from value]
+ Found item [svcType='4'] index: 6666.35815424.102 [from value]
+ Found item [svcType='4'] index: 6667.35815424.202 [from value]
+ Found item [svcType='3'] index: 314159.35782656.4000 [from value]
+ Found item [svcType='3'] index: 314159.35782656.4001 [from value]
+ Found item [svcType='3'] index: 314159.35782656.4002 [from value]
+ Located input field 'IOH1' [get]
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.1.69271552.0' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.4.69238784.0' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.9.69435392.100' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.12.35946496.0' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.14.1342177281.268372230' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.41.69304320.4095' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.42.1342177281.268372244' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.42.1342177281.268372343' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.50.639664197.0' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.52.639664249.0' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.101.69337088.0' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.102.35782656.4095' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.200.1342177281.268371020' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.666.35815424.101' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.6666.35815424.102' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.6667.35815424.202' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.314159.35782656.4000' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.314159.35782656.4001' [value='']
+ Executing SNMP get for data @ '.1.3.6.1.4.1.1234.3.1.2.4.3.7.1.4.314159.35782656.4002' [value='']
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/rtr_interface.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/rtr_interface.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/rtr_interface.xml'
BorisL
Cacti User
Posts: 131
Joined: Sat Mar 31, 2007 9:21 am
Contact:

Post by BorisL »

Code: Select all

find /path/to/your/cacti/installation -name \*.php | xargs grep oid_suffix
acvolt
Posts: 14
Joined: Thu Apr 28, 2005 11:48 am

Post by acvolt »

/var/www/cacti/lib/utility.php: if (isset($snmp_queries["fields"]{$output["snmp_field_name"]}["oid_suffix"])) {
/var/www/cacti/lib/utility.php: $oid .= "." . $snmp_queries["fields"]{$output["snmp_field_name"]}["oid_suffix"];
BorisL
Cacti User
Posts: 131
Joined: Sat Mar 31, 2007 9:21 am
Contact:

Post by BorisL »

Apply this patch, this should fix direction=input, but direction=output should work OK, there is some other problem.
Attachments
issue1341-add.patch
Additional patch
(619 Bytes) Downloaded 258 times
acvolt
Posts: 14
Joined: Thu Apr 28, 2005 11:48 am

Post by acvolt »

Your patch fixed it for direction = input.

When I try to create graphs when direction = output the datasource is created, but never shows up in the poller list or cacti log with logging set to include results.
BorisL
Cacti User
Posts: 131
Joined: Sat Mar 31, 2007 9:21 am
Contact:

Post by BorisL »

Make a screenshot of broken data source and

Code: Select all

select * from poller_item where local_data_id=...
where ...= id of screenshoted datasource.
acvolt
Posts: 14
Joined: Thu Apr 28, 2005 11:48 am

Post by acvolt »

Here is the SQL output:
mysql> select * from poller_item where local_data_id=8199;
Empty set (0.00 sec)

Attached are the screenshots of the datasource.
Attachments
URL of the website
URL of the website
URL.PNG (7.85 KiB) Viewed 6916 times
Text Fields of the Data Source.
Text Fields of the Data Source.
text fields.PNG (22.42 KiB) Viewed 6916 times
BorisL
Cacti User
Posts: 131
Joined: Sat Mar 31, 2007 9:21 am
Contact:

Post by BorisL »

Well, you have broken data source to data query linkage, this is not oid_suffix failure since there are no records in poller_item (broken oid_suffix may cause wrong arg1 field, not absence of rows).
Double check you data query configuration.
acvolt
Posts: 14
Joined: Thu Apr 28, 2005 11:48 am

Post by acvolt »

After much looking I found the problem. I had method set to get instead of walk.

Thank you BorisL for the assistance you gave me with this problem. It was very much appreciated.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests