Always getting NaN value for newly created data source.

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

Moderators: Developers, Moderators

Post Reply
smoke54321
Posts: 2
Joined: Sun Jan 13, 2013 6:22 pm

Always getting NaN value for newly created data source.

Post by smoke54321 »

Dear Support Team,

I am trying to monitor one network parameter (which I retrieve with help of the custom script) with cacti and getting following issue:

Code: Select all

rrdtool dump /srv/www/htdocs/cacti/rra/b2b_platform_http_response_13.rrd | head -n20
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump -->
<rrd>
        <version>0003</version>
        <step>300</step> <!-- Seconds -->
        <lastupdate>1358119276</lastupdate> <!-- 2013-01-14 00:21:16 CET -->

        <ds>
                <name> HTTP_response </name>
                <type> GAUGE </type>
                <minimal_heartbeat>600</minimal_heartbeat>
                <min>0.0000000000e+00</min>
                <max>NaN</max>

                <!-- PDP Status -->
                <last_ds>[color=#40BF00]199[/color]</last_ds>
                <value>[color=#FF0000]NaN[/color]</value>
                <unknown_sec> 76 </unknown_sec>
        </ds>
I always get NaN instead of the normal value. If look through cacti logs, I do not see anything suspicious here:

Code: Select all

01/14/2013 12:21:16 AM - CMDPHP: Poller[0] Host[3] DS[13] CMD: /srv/www/htdocs/cacti/scripts/Tmes.sh https://gsm-b2b.com/, output: 199[/color]
01/14/2013 12:21:16 AM - CMDPHP: Poller[0] DEVEL: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (13, 'HTTP_response', '2013-01-14 00:21:16', '199')"
01/14/2013 12:21:16 AM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "select  poller_output.output,  poller_output.time,  UNIX_TIMESTAMP(poller_output.time) as unix_time,  poller_output.local_data_id,  poller_item.rrd_path,  poller_item.rrd_name,  poller_item.rrd_num  from (poller_output,poller_item)  where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name)  LIMIT 10000"
01/14/2013 12:21:16 AM - CMDPHP: Poller[0] Time: 0.9800 s, Theads: N/A, Hosts: 3
01/14/2013 12:21:16 AM - CMDPHP: Poller[0] DEVEL: SQL Exec: "UPDATE poller_time SET end_time=NOW() WHERE pid=9159"
01/14/2013 12:21:16 AM - CMDPHP: Poller[0] DEVEL: SQL Exec: "DELETE FROM poller_output WHERE local_data_id IN (13)"
01/14/2013 12:21:16 AM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "SELECT 1 AS id, ph.name, ph.file, ph.function  FROM plugin_hooks AS ph  LEFT JOIN plugin_config AS pc  ON pc.directory=ph.name  WHERE ph.status = 1 AND hook = 'poller_output'  AND ph.name IN ('settings', 'boost', 'dsstats')  UNION  SELECT pc.id, ph.name, ph.file, ph.function  FROM plugin_hooks AS ph  LEFT JOIN plugin_config AS pc  ON pc.directory=ph.name  WHERE ph.status = 1 AND hook = 'poller_output'  AND ph.name NOT IN ('settings', 'boost', 'dsstats')  ORDER BY id ASC"
01/14/2013 12:21:16 AM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "SELECT 1 AS id, ph.name, ph.file, ph.function  FROM plugin_hooks AS ph  LEFT JOIN plugin_config AS pc  ON pc.directory=ph.name  WHERE ph.status = 1 AND hook = 'poller_on_demand'  AND ph.name IN ('settings', 'boost', 'dsstats')  UNION  SELECT pc.id, ph.name, ph.file, ph.function  FROM plugin_hooks AS ph  LEFT JOIN plugin_config AS pc  ON pc.directory=ph.name  WHERE ph.status = 1 AND hook = 'poller_on_demand'  AND ph.name NOT IN ('settings', 'boost', 'dsstats')  ORDER BY id ASC"
[color=#40BF00]01/14/2013 12:21:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /srv/www/htdocs/cacti/rra/b2b_platform_http_response_13.rrd --template HTTP_response 1358119276:199[/color]
So, I clearly see that retrieved value is correct and rrd file going to be updated in a correct way. And it updates, but not the "value" field. I actually have no ideas what is the reason of issue. Looks like it is somehow related to data template configuration, but I have no ideas, what could be wrong with such simple procedure.

System info:

Cacti Version 0.8.8a
Cacti OS unix
SNMP Version NET-SNMP version: 5.6.1
RRDTool Version RRDTool 1.4.x
Hosts 3
Graphs 7
Data Sources Script/Command: 10
SNMP: 1
Total: 11

BTW, if it is needed, rrdtool info output is here:

Code: Select all

rrdtool info /srv/www/htdocs/cacti/rra/b2b_platform_http_response_13.rrd | head -n20
filename = "/srv/www/htdocs/cacti/rra/b2b_platform_http_response_13.rrd"
rrd_version = "0003"
step = 300
last_update = 1358119276
header_size = 2464
ds[HTTP_response].index = 0
ds[HTTP_response].type = "GAUGE"
ds[HTTP_response].minimal_heartbeat = 600
ds[HTTP_response].min = 0.0000000000e+00
ds[HTTP_response].max = NaN
ds[HTTP_response].last_ds = "199"
ds[HTTP_response].value = NaN
ds[HTTP_response].unknown_sec = 76
rra[0].cf = "AVERAGE"
rra[0].rows = 500
rra[0].cur_row = 342
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0

Sorry if missed something. This is my first contact of cacti support.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Always getting NaN value for newly created data source.

Post by gandalf »

Well, this indeed lokks all very nice.
- data is fetched
- mysql poller_output is populated
- rrd update is done
- rrd info shows correct data source name, step and heartbeat - MAX is ok, last value is shown
- rrd dump shows last value but not the current one

So please run
/usr/bin/rrdtool update /srv/www/htdocs/cacti/rra/b2b_platform_http_response_13.rrd --template HTTP_response N:199
several times covering some 20 minutes on an approximate interval of 300 sec.
rrd dump should look better, then
R.
smoke54321
Posts: 2
Joined: Sun Jan 13, 2013 6:22 pm

Re: Always getting NaN value for newly created data source.

Post by smoke54321 »

It really helped) Did a few database updates and now have actual value at place. Thanks a lot.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests