Data source verification failure

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

Moderators: Developers, Moderators

Post Reply
CyberTod
Posts: 5
Joined: Mon Jun 28, 2021 12:48 am

Data source verification failure

Post by CyberTod »

I am trying to make a graph for Mikrotik Signal Strength.
I have a Data Query which worked in v0.8.8. Since I updated to v1.2.17 it stopped working.
It gives this error :

The Operation was successful.
Details are below.
NOTE: Graph not for Data Query SNMP - Mikrotik - Signal Strength and index due to Data Source verification failure.

The index is read. I can see the mac address of the station. But when I click to create a graph I get the above message. Doing manual snmpwalk on the OIDs in the .xml file give proper result.

If I do a verbose query from the Device screen no errors are given :
Data Query Debug Information
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/mikrotik_signal_strength.xml'
Total: 0.000000, Delta: 0.000000, Running Data Query [10].
Total: 0.000000, Delta: 0.000000, Found Type = '3' [SNMP Query].
Total: 0.000000, Delta: 0.000000, XML file parsed ok.
Total: 0.000000, Delta: 0.000000, Auto Bulk Walk Size Selected.
Total: 0.050000, Delta: 0.050000, Tested Bulk Walk Size 1 with a response of 0.0502.
Total: 0.080000, Delta: 0.030000, Tested Bulk Walk Size 5 with a response of 0.0274.
Total: 0.110000, Delta: 0.030000, Tested Bulk Walk Size 10 with a response of 0.0312.
Total: 0.110000, Delta: 0.000000, Bulk Walk Size selected was 5.
Total: 0.110000, Delta: 0.000000, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 0.110000, Delta: 0.000000, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.14988.1.1.1.2.1.1' Index Count: 1
Total: 0.110000, Delta: 0.000000, Index found at OID: '.1.3.6.1.4.1.14988.1.1.1.2.1.1.212.202.109.149.130.189.2' value: 'm'
Total: 0.110000, Delta: 0.000000, Filtering list of indexes @ '.1.3.6.1.4.1.14988.1.1.1.2.1.1' Index Count: 1
Total: 0.110000, Delta: 0.000000, Filtered Index found at OID: '.1.3.6.1.4.1.14988.1.1.1.2.1.1.212.202.109.149.130.189.2' value: '12.202.109.149.130.189.2'
Total: 0.110000, Delta: 0.000000, Inserting index data for field 'signalStrengthIndex' [value='12.202.109.149.130.189.2']
Click to show Data Query output for field 'signalStrengthDevice'
Total: 0.110000, Delta: 0.000000, Located input field 'signalStrengthDevice' [walk]
Total: 0.160000, Delta: 0.050000, Executing SNMP walk for data @ '.1.3.6.1.4.1.14988.1.1.1.2.1.1'
Found item [signalStrengthDevice='m'] index: 12.202.109.149.130.189.2 [from value]
Total: 0.170000, Delta: 0.010000, Checking for Sort Field change. No changes detected.
Total: 0.170000, Delta: 0.000000, Update Data Query Sort Cache complete
Total: 0.170000, Delta: 0.000000, Index Association with Local Data complete
Total: 0.200000, Delta: 0.040000, No Index Changes Detected, Skipping Re-Index and Poller Cache Re-population
Total: 0.200000, Delta: 0.000000, Automation Executing for Data Query complete
Total: 0.200000, Delta: 0.000000, Plugin hooks complete
CyberTod
Posts: 5
Joined: Mon Jun 28, 2021 12:48 am

Re: Data source verification failure

Post by CyberTod »

To answer my own question. The problem was that .xml file to get the indexed data has this line :
<oid_index_parse>OID/REGEXP:^.{30}(.*)</oid_index_parse>

This in v0.8.8 returns an index like this : 8.85.49.160.194.152.1
But in v.1.2.17 the same .xml file returns the index with a leading dot: .8.85.49.160.194.152.1

The error is returned because when a graph is created in v.1.2.17 it passes through a function test_data_source() which tries to get the data and if the data is not valid it returns this error.
And in this case there is a line of code that adds a dot between the index and the value :
$oid = $snmp_queries['fields'][$output['snmp_field_name']]['oid'] . '.' . $snmp_index;

So actually the full OID becomes .1.3.6.1.4.1.14988.1.1.1.2.1.3..181.194.244.160.83.4 - there is a double dot and the SNMP query fails.

The fix was to change the regexp to remove the leading dot from the OID :
<oid_index_parse>OID/REGEXP:^\.+.{30}(.*)</oid_index_parse>

Now I can add the graphs and they work.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest