Problem to add new php script, 1 working fine, 3 others not

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

Moderators: Developers, Moderators

Post Reply
sdetroch
Posts: 26
Joined: Thu Mar 31, 2005 7:39 pm

Problem to add new php script, 1 working fine, 3 others not

Post by sdetroch »

Hello,

today I tried to add 4 new counters to cacti. These are all based on a php script that is fired on the cacti server and is counting records from a mysql database.

I've added the 4 counters at the same time, on exactly the same way.
One is working fine, the 3 others not (zero's on the graph).

The php output (on the cli) is similar for all 4 graphs (and outputs are numbers). The only difference between the 4 scripts is the outputs in terms of the numbers (small numbers versus large numbers):

- the working graph has a php output of around 400
- the not working graphs have outputs around 1 million and more

Could this be the cause (because all output and debugging are not returning any errors)? I've tried to use the 'largenumbers', 'integer' and other settings in the graph templates to check if 'a million cannot be displayed on a graph), but the 3 graphs are staying on zero's, wahtever I change. In the past I was able to graph the same scripts correctly, but this was on another server and another cacti version (and I don't have access to that machine anymore to compare the settings)

Can someone assist?

thanks,
Sven
sdetroch
Posts: 26
Joined: Thu Mar 31, 2005 7:39 pm

Post by sdetroch »

extra info:
- the timestamps of the RRA's are updated each polling cycle (for the 4 graphs)
- changing graph types from line to area ... doesnt' change anything neither
- using version Version 0.8.7b with all patches


example output of the working graph:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1213312143 \
--end=1213398543 \
--title="VB Users Online" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 13/Jun/2008 01\:09\:03 To 14/Jun/2008 01\:09\:03\c" \
COMMENT:" \n" \
--vertical-label="# users" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
--font AXIS:6:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
--font LEGEND:8:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
--font UNIT:8:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
DEF:a="/cacti/rra/vbuonline_364.rrd":VBUONLINE:AVERAGE \
DEF:b="/cacti/rra/vbuonline_364.rrd":VBUONLINE:LAST \
DEF:c="/cacti/rra/vbuonline_364.rrd":VBUONLINE:MIN \
DEF:d="/cacti/rra/vbuonline_364.rrd":VBUONLINE:MAX \
AREA:a#00519966:"# users" \
GPRINT:b:LAST:"Current\:%8.00lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.00lf %s" \
GPRINT:d:MAX:"Maximum\:%8.00lf %s\n" \



example output of one of the three not workng graphs:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1213384191 \
--end=1213398291 \
--title="VB Postings" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 13/Jun/2008 21\:09\:51 To 14/Jun/2008 01\:04\:51\c" \
COMMENT:" \n" \
--vertical-label="# topics" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
--font AXIS:6:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
--font LEGEND:8:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
--font UNIT:8:/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
DEF:a="/cacti/rra/vbposts_365.rrd":VBPOSTS:AVERAGE \
DEF:b="/cacti/rra/vbposts_365.rrd":VBPOSTS:LAST \
DEF:c="/cacti/rra/vbposts_365.rrd":VBPOSTS:MIN \
DEF:d="/cacti/rra/vbposts_365.rrd":VBPOSTS:MAX \
LINE2:a#00519999:"# topics" \
GPRINT:b:LAST:"Current\:%8.00lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.00lf %s" \
GPRINT:d:MAX:"Maximum\:%8.00lf %s\n" \
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I suppose it's the MAX issue with the data source mentioned at the second link of my sig
Reinhard
sdetroch
Posts: 26
Joined: Thu Mar 31, 2005 7:39 pm

Post by sdetroch »

Gandalf,

thanks for the pointer, seems to be that problem I assume:

output of the FETCH command:

1213395000: nan
1213395300: nan
1213395600: 0.0000000000e+00
1213395900: nan
1213396200: nan
1213396500: nan
1213396800: nan
1213397100: nan
1213397400: nan
1213397700: nan
1213398000: nan
1213398300: nan
1213398600: nan
1213398900: nan
1213399200: nan
1213399500: nan
1213399800: nan
1213400100: nan
1213400400: nan
1213400700: nan
1213401000: nan
1213401300: nan
(and the rest are all nan's as well)

and the INFO results in:

rrd_version = "0003"
step = 300
last_update = 1213481110
ds[VBPOSTS].type = "GAUGE"
ds[VBPOSTS].minimal_heartbeat = 600
ds[VBPOSTS].min = 0.0000000000e+00
ds[VBPOSTS].max = NaN
ds[VBPOSTS].last_ds = "UNKN"
ds[VBPOSTS].value = 0.0000000000e+00
ds[VBPOSTS].unknown_sec = 10


Can you tell me if the above causes the problem and which "rrdtool tune" parameter I should use (the output of the php scripts are around 2 à 5 mio, so 10 or 15 mio should be a sufficient maximum value for the future).

thanks in upfront!
Sven
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That seems to be ok.

ds[VBPOSTS].max = NaN

shows no MAX value that may perform clipping. There must be a different reason.
Reinhard
sdetroch
Posts: 26
Joined: Thu Mar 31, 2005 7:39 pm

Post by sdetroch »

Gandalf,

any other ideas where I could configured it wrong. The php scripts are working and the 4 graphs are configured the same way. Very strange, I must do something wrong, but what ...
Sven
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

So let's do it step by step. First one is to post a screenshot of the Data Input Method. Did you add an output parm to that DIM after it was used for the first time?
Reinhard
sdetroch
Posts: 26
Joined: Thu Mar 31, 2005 7:39 pm

Post by sdetroch »

Just a little posting to tell you that I found the error, stupid me :oops:

The output of my phpscripts that were failing had:
<EMPTY LINE> RESULT in stead of RESULT

I removed the empty line in the php scripts and everyhting is working fine now. Thanks for the assistance!

Sven
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests