(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: Developers, Moderators

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

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

Post by bmfmancini »

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 bmfmancini on Wed Jan 15, 2020 11:09 am, edited 1 time in total.
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

Any ideas on this anyone ???
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

More than likely a permission issue with the RRD directory.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

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
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

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.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

In my setup the killer is using the apache user
But let me triple Check
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

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 2448 times
the graph template works fine as well since realtime generated the graph
head-scratcher on this one
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

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
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

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
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

well that was short lived
the data source now reports NaN again :(
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

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
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

When editing the data source, does your RRD match the expected list of sources?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

sorry not following

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

This is what the data source looks like when attached to a device
nokiad4.JPG
nokiad4.JPG (75.51 KiB) Viewed 2439 times
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

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

Post by bmfmancini »

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
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

What user does your poller run as from cron?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests