Graph says "nan" but data source debug shows data.

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

Moderators: Developers, Moderators

Post Reply
klieber
Posts: 3
Joined: Thu Nov 17, 2005 12:29 pm
Contact:

Graph says "nan" but data source debug shows data.

Post by klieber »

  • cacti 0.8.6f
  • rrdtool 1.2.6
  • mysql 4.0.24
I've been setting up these scripts to track some phpBB stats for our forums. The phpbb2stats script works great. The phpbb2users script, however, is causing some problems. The graph is drawn, but constantly reports "nan" or no data.

If I go in to the data source itself and turn on debugging, I see:

Code: Select all

/usr/bin/rrdtool create \
/path/to/files/cacti/rra/dove_guests_848.rrd \
--step 300  \
DS:registered:GAUGE:600:0:50 \
DS:guests:GAUGE:600:0:50 \
RRA:AVERAGE:0.5:6:17520 \
RRA:AVERAGE:0.5:1:105120 \
RRA:AVERAGE:0.5:24:4380 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:6:17520 \
RRA:MIN:0.5:1:105120 \
RRA:MIN:0.5:24:4380 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:6:17520 \
RRA:MAX:0.5:1:105120 \
RRA:MAX:0.5:24:4380 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:105120 \
RRA:LAST:0.5:24:4380 \
RRA:LAST:0.5:6:17520 \
RRA:LAST:0.5:288:797 \
Which looks correct to me.

If I run the perl script manually as the cacti user, it spits out the results just fine as well.

The RRD file exists in /cacti/rra/ and RRDTool seems to like it....what am I doing wrong? (what's really puzzling is the other phpBB script works fine)

--kurt
Gentoo Linux
http://www.gentoo.org
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

To debug data gathering, please switch to DEBUG mode for at least one polling cycle. You should find the call of the perl script in there with the results returned.
If this looks fine, please search for the appropriate rrdtool update statement for that rrd that you have mentioned in your post.
If it turns out to be a graphing problem, please select the wrench next to the graph to see the rrdtoll grapg statements. Run them from cli to check for errors or post your findings
Reinhard
klieber
Posts: 3
Joined: Thu Nov 17, 2005 12:29 pm
Contact:

Post by klieber »

As an update, after leaving the graph running overnight, it does produce some data, but only sporadically. It appears to be during the slower periods of our forum, so perhaps this is all somehow load related?

Turning on debug mode produced:

Code: Select all

11/18/2005 02:45:30 PM - CACTID: Poller[0] Host[46] DS[848] SCRIPT: /usr/bin/perl /path/to/files/cacti/scripts/phpbb2users.pl, output: guests:244 registered:89
So that appears to be working. Later in the log, I see:

Code: Select all

11/18/2005 02:45:31 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /path/to/files/cacti/rra/dove_guests_848.rrd --template guests:registered 1132325101:244:89
11/18/2005 02:46:21 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph -  --imgformat=PNG  --start=1132238780  --end=1132325180  --title="dove - phpBB2 - Users Online"  --base=1000  --height=120  --width=750  --alt-autoscale-max  --lower-limit=0  COMMENT:"From 2005/11/17 14\:46\:20 To 2005/11/18 14\:46\:20\c"  COMMENT:"  \n"  --vertical-label="Users Online"  --slope-mode  DEF:a="/path/to/files/cacti/rra/dove_guests_848.rrd":registered:AVERAGE  DEF:b="/path/to/files/cacti/rra/dove_guests_848.rrd":guests:AVERAGE  CDEF:cdefba=TIME,1132324881,GT,a,a,UN,0,a,IF,IF,TIME,1132324881,GT,b,b,UN,0,b,IF,IF,+  AREA:a#9FA4EE:"Registered"   GPRINT:a:LAST:"Current\:%8.0lf"   GPRINT:a:MIN:"Minimum\:%8.0lf"   GPRINT:a:MAX:"Maximum\:%8.0lf"   GPRINT:a:AVERAGE:"Average\:%8.0lf\n"   AREA:b#FF897C:"Guests":STACK  GPRINT:b:LAST:"    Current\:%8.0lf"   GPRINT:b:MIN:"Minimum\:%8.0lf"   GPRINT:b:MAX:"Maximum\:%8.0lf"   GPRINT:b:AVERAGE:"Average\:%8.0lf\n"   LINE1:cdefba#000000:"Total"   GPRINT:cdefba:LAST:"     Current\:%8.0lf"   GPRINT:cdefba:MIN:"Minimum\:%8.0lf"   GPRINT:cdefba:MAX:"Maximum\:%8.0lf"   GPRINT:cdefba:AVERAGE:"Average\:%8.0lf\n"
Which I don't know if that's accurate or not...

The wrench shows:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1132238780 \
--end=1132325180 \
--title="dove - phpBB2 - Users Online" \
--base=1000 \
--height=120 \
--width=750 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2005/11/17 14\:46\:20 To 2005/11/18 14\:46\:20\c" \
COMMENT:"  \n" \
--vertical-label="Users Online" \
--slope-mode \
DEF:a="/path/to/files/cacti/rra/dove_guests_848.rrd":registered:AVERAGE \
DEF:b="/path/to/files/cacti/rra/dove_guests_848.rrd":guests:AVERAGE \
CDEF:cdefba=TIME,1132325026,GT,a,a,UN,0,a,IF,IF,TIME,1132325026,GT,b,b,UN,0,b,IF,IF,+ \
AREA:a#9FA4EE:"Registered"  \
GPRINT:a:LAST:"Current\:%8.0lf"  \
GPRINT:a:MIN:"Minimum\:%8.0lf"  \
GPRINT:a:MAX:"Maximum\:%8.0lf"  \
GPRINT:a:AVERAGE:"Average\:%8.0lf\n"  \
AREA:b#FF897C:"Guests":STACK \
GPRINT:b:LAST:"    Current\:%8.0lf"  \
GPRINT:b:MIN:"Minimum\:%8.0lf"  \
GPRINT:b:MAX:"Maximum\:%8.0lf"  \
GPRINT:b:AVERAGE:"Average\:%8.0lf\n"  \
LINE1:cdefba#000000:"Total"  \
GPRINT:cdefba:LAST:"     Current\:%8.0lf"  \
GPRINT:cdefba:MIN:"Minimum\:%8.0lf"  \
GPRINT:cdefba:MAX:"Maximum\:%8.0lf"  \
GPRINT:cdefba:AVERAGE:"Average\:%8.0lf\n" 
I don't know enough about RRDTool to make much sense of the above. Any help is appreciated.
Gentoo Linux
http://www.gentoo.org
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Well, the perl script output looks good, and rrdtool update statement is ok. Graph statement does not contain anything ugly.
So your problem is intermitting data (sometimes ok, sometimes not), right? Is it the only failing one? Does the script always finish in time?
Reinhard
klieber
Posts: 3
Joined: Thu Nov 17, 2005 12:29 pm
Contact:

Post by klieber »

lvm wrote:So your problem is intermitting data (sometimes ok, sometimes not), right? Is it the only failing one? Does the script always finish in time?
Yes, that's the problem and it's not the only graph that has the issue, though it's by far the worst one. The other phpBB2-related graph (tracking # of posts) fails as well, but only about 5% of the time.

How would I tell if the script always finishes in time? Do I need to turn on debugging for an extended period? Alternately, is there any way to increase the timeout period that cactid waits to receive data back from the script?

--kurt
Gentoo Linux
http://www.gentoo.org
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

See Settings -> Poller for this: Script and Script Server Timeout
Switching log level to DEBUG will show you, when your scripts start and finish. So you may have an impression on how fast they are (well, submitting the from shell would work either) and what they do respond.
Reinhard
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

Hi,

a similar problem here
see alos http://forums.cacti.net/viewtopic.php?t ... highlight=

Torsten
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests