Problem to add new php script, 1 working fine, 3 others not
Moderators: Developers, Moderators
Problem to add new php script, 1 working fine, 3 others not
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
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
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" \
GPRINTLAST:"Current\:%8.00lf %s" \
GPRINTAVERAGE:"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" \
GPRINTLAST:"Current\:%8.00lf %s" \
GPRINTAVERAGE:"Average\:%8.00lf %s" \
GPRINT:d:MAX:"Maximum\:%8.00lf %s\n" \
- 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" \
GPRINTLAST:"Current\:%8.00lf %s" \
GPRINTAVERAGE:"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" \
GPRINTLAST:"Current\:%8.00lf %s" \
GPRINTAVERAGE:"Average\:%8.00lf %s" \
GPRINT:d:MAX:"Maximum\:%8.00lf %s\n" \
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
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
Who is online
Users browsing this forum: No registered users and 0 guests