(Resolved )Custom Data query graph works in realtime view but not regular poller

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Author
Message
seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

(Resolved )Custom Data query graph works in realtime view but not regular poller

#1 Post by seanmancini » Sat Dec 07, 2019 12:29 am

Hey Guys

I made a simple data source to graph optical levels
here is my query

It's been a while since I've run into this issue I usually have good luck creating my custom graphs and queries this one is being a bit difficult

Here is the setup

just 2 queries on for the sfp to find out if its internally or externally calibrated
and the OID for the light levels

<interface>
<oid_index>.1.3.6.1.4.1.6527.3.1.2.2.4.31.1.40</oid_index>
<index_order>calb:OptiPort</index_order>
<fields>



<calb>
<name>Calibration type</name>
<method>walk</method>
<output_format>value</output_format>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.6527.3.1.2.2.4.31.1.40</oid>
</calb>
<OptiPort>
<name>Optical Port Selection</name>
<method>walk</method>
<output_format>value</output_format>
<source>value</source>
<direction>input-output</direction>
<oid>.enterprises.6527.3.1.2.2.4.31.1.21.1</oid>
</OptiPort>
</fields>
</interface>


The graphs create wihtout issues but all NAN unless in realtime view where it works fine

doing a debug on the data source shows Last U and Value NaN
Permission are fine

I have the data query set to get SNMP indexed pointing to the graph template as a data source
so what is realtime doing differnt than the poller that it can get the graph working but the poller cant ?

Thanks guys !
Last edited by seanmancini on Wed Jan 15, 2020 11:09 am, edited 1 time in total.

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#2 Post by seanmancini » Mon Dec 09, 2019 9:36 am

Any ideas on this anyone ???


seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#4 Post by seanmancini » Mon Dec 09, 2019 7:40 pm

Permissions are fine

It's just this query and template that I'm having a problem with

I wish it was always something easy like permissions lol

netniV
Cacti Guru User
Posts: 3132
Joined: Sun Aug 27, 2017 12:05 am

Re: Custom Data query graph works in realtime view but not regular poller

#5 Post by netniV » Mon Dec 09, 2019 7:43 pm

It still sounds like permissions to me. The only real difference between the two is that Realtime doesn't go via the RRD's. And the poller often uses a different user to the http daemon.

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#6 Post by seanmancini » Mon Dec 09, 2019 7:49 pm

In my setup the killer is using the apache user
But let me triple Check

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#7 Post by seanmancini » Tue Dec 10, 2019 10:44 am

wow for the typo lol killer = poller

I checked graph permissions they are good the DS comes back with NaN so not getting any values

nan.JPG
nan.JPG (58.77 KiB) Viewed 146 times
the graph template works fine as well since realtime generated the graph
head-scratcher on this one

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#8 Post by seanmancini » Tue Dec 10, 2019 10:53 am

Here is the output of the query





Data Query Debug Information
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/nokia-optical.xml'
Total: 0.000000, Delta: 0.000000, Running Data Query [25].
Total: 0.010000, Delta: 0.000000, Found Type = '3' [SNMP Query].
Total: 0.010000, Delta: 0.000000, XML file parsed ok.
Total: 0.010000, Delta: 0.000000, <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
Total: 0.770000, Delta: 0.760000, Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.6527.3.1.2.2.4.31.1.40' Index Count: 1
Total: 0.770000, Delta: 0.000000, Index found at OID: '.1.3.6.1.4.1.6527.3.1.2.2.4.31.1.40.1.35684352' value: '2'
Click to show Data Query output for field 'OptiInt'
Total: 0.770000, Delta: 0.000000, Located input field 'OptiInt' [walk]
Total: 0.930000, Delta: 0.160000, Executing SNMP walk for data @ '.enterprises.6527.3.1.2.2.4.2.1.6.1.35684352'
Found item [OptiInt='1/1/1'] index: 35684352 [from value]
Click to show Data Query output for field 'calb'
Total: 0.930000, Delta: 0.000000, Located input field 'calb' [walk]
Total: 1.580000, Delta: 0.650000, Executing SNMP walk for data @ '.1.3.6.1.4.1.6527.3.1.2.2.4.31.1.40'
Found item [calb='2'] index: 35684352 [from value]
Click to show Data Query output for field 'OptiPort'
Total: 1.580000, Delta: 0.000000, Located input field 'OptiPort' [walk]
Total: 2.410000, Delta: 0.840000, Executing SNMP walk for data @ '.enterprises.6527.3.1.2.2.4.31.1.21.1'
Found item [OptiPort='366'] index: 35684352 [from value]
Total: 2.430000, Delta: 0.020000, Checking for Sort Field change. No changes detected.
Total: 2.430000, Delta: 0.000000, Update Data Query Sort Cache complete
Total: 2.840000, Delta: 0.410000, Index Association with Local Data complete
Total: 2.960000, Delta: 0.120000, No Index Changes Detected, Skipping Re-Index and Poller Cache Re-population
Total: 3.010000, Delta: 0.050000, Automation Execution for Data Query complete
Total: 3.020000, Delta: 0.000000, Plugin Hooks complete

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#9 Post by seanmancini » Tue Dec 10, 2019 11:24 am

Ok so I adjusted my query it now looks like this

<interface>
<oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
<index_order>OptiPort:calb:OptiInt</index_order>
<oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>

<fields>

<ifIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.2.2.1.1</oid>
</ifIndex>
<OptiInt>
<name>Optical Interface</name>
<method>walk</method>
<output_format>value</output_format>
<source>value</source>
<direction>input</direction>
<oid>.enterprises.6527.3.1.2.2.4.2.1.6.1</oid>
</OptiInt>
<calb>
<name>Calibration type</name>
<method>walk</method>
<output_format>value</output_format>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.6527.3.1.2.2.4.31.1.40</oid>
</calb>
<OptiPort>
<name>Optical levels</name>
<method>walk</method>
<output_format>value</output_format>
<source>value</source>
<direction>input-output</direction>
<oid>.enterprises.6527.3.1.2.2.4.31.1.21.1</oid>
</OptiPort>

</fields>
</interface>


this is to include the interface index as well
now the DS is reporting last value of 0 as of the last poll which is a good sign
lets see what happens

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#10 Post by seanmancini » Tue Dec 10, 2019 11:27 am

well that was short lived
the data source now reports NaN again :(

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#11 Post by seanmancini » Tue Dec 10, 2019 2:04 pm

Oh here is the graph debug output as well


RRDtool Command:

/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-60' \
--pango-markup \
--title='******* -- Optical Levels' \
--slope-mode \
--base=1000 \
--height=150 \
--width=500 \
--rigid \
--alt-autoscale-max \
--lower-limit='-40' \
COMMENT:"From 2019/12/09 14\:03\:10 To 2019/12/10 14\:02\:10\c" \
COMMENT:" \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border 1 --font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
DEF:a='/var/www/html/cacti/rra/*****':MAX \
DEF:b='/var/www/html/cacti/rra/****':LAST \
CDEF:cdefa='a,10000,/,LOG,10,*,2.303,/' \
CDEF:cdefb='b,10000,/,LOG,10,*,2.303,/' \
LINE1:cdefa#E42217FF: \
GPRINT:cdefb:LAST:'DB%8.2lf%s\n'

RRDtool Says:

OK

netniV
Cacti Guru User
Posts: 3132
Joined: Sun Aug 27, 2017 12:05 am

Re: Custom Data query graph works in realtime view but not regular poller

#12 Post by netniV » Wed Dec 11, 2019 9:05 am

When editing the data source, does your RRD match the expected list of sources?

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#13 Post by seanmancini » Wed Dec 11, 2019 11:07 am

sorry not following

the query is exporting the OptiPort field to the grah template
nokiad.JPG
nokiad.JPG (26.67 KiB) Viewed 137 times
Here is the graph template import items
nokiad1.JPG
nokiad1.JPG (91.1 KiB) Viewed 137 times
Here is the data source template
nokiad2.JPG
nokiad2.JPG (83.81 KiB) Viewed 137 times

This is what the data source looks like when attached to a device
nokiad4.JPG
nokiad4.JPG (75.51 KiB) Viewed 137 times

seanmancini
Cacti User
Posts: 110
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Custom Data query graph works in realtime view but not regular poller

#14 Post by seanmancini » Wed Dec 11, 2019 2:57 pm

oh and just for refernce here is the RRA file permissions

-rw-r--r-- 1 apache apache 321K Dec 11 14:55 xxxxxxxx_nokia_optical_93453.rrd


Post Reply