Discussion:
[rrd-users] graph question
(too old to reply)
Simon Hobson
2015-11-21 22:17:22 UTC
Permalink
But when i create the graph, the temperature curve shows only positive temperature and not negative temperature.
When the temperature is going under 0 C, the curve is blank then become visible when temperature is positive.
I can't see anything wrong with either command.
What data are you putting in ?
What data is stored - use rrdtool fetch to dump it ?

It might be worth creating a test file and putting known test data into it, then see what comes out.
Steve Shipway
2015-11-22 20:37:59 UTC
Permalink
Use rrdtool info /opt/templog/data/templog.rrd and check to make sure that the ‘internal’ and ‘external’ DS really do have -55 as the lowerlimit and not 0. The behaviour you describe looks like the lower limit is set to 0 (as the data seem to be absent from the RRD).



You may also wish to verify that you really are storing the data correctly. It is possible that the script you are using to update the RRD with the temperature data is not correctly handling negative numbers, and is not storing the data successfully.



Steve



Steve Shipway

T: +64 9 3737 599 ext 86487

E: ***@auckland.ac.nz <mailto:***@auckland.ac.nz>

(GNU Terry Pratchett)



From: rrd-users [mailto:rrd-users-bounces+s.shipway=***@lists.oetiker.ch] On Behalf Of s pascal
Sent: Saturday, 21 November 2015 4:27 p.m.
To: rrd-***@lists.oetiker.ch
Subject: [FORGED] [rrd-users] graph question



Hi ,

i have this code to create the graph file

#!/bin/sh
rrdtool graph /var/www/temp_graph.png \
-w 1024 -h 400 -a PNG --slope-mode \
--start -1d --end now \
--vertical-label "temperature (C)" \
DEF:out=/opt/templog/data/templog.rrd:internal:AVERAGE \
DEF:in=/opt/templog/data/templog.rrd:external:AVERAGE \
LINE2:in#00ff00:"inside" \
LINE2:out#000ff:"outside"



And this file to create the rrd file:

#!/bin/sh
rrdtool create /opt/templog/data/templog.rrd --step 300 \
DS:internal:GAUGE:600:-55:125 \
DS:external:GAUGE:600:-55:125 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:3:1344 \
RRA:AVERAGE:0.5:12:1488 \
RRA:AVERAGE:0.5:72:1984 \
RRA:MIN:0.5:72:1984 \
RRA:MAX:0.5:72:1984



But when i create the graph, the temperature curve shows only positive temperature and not negative temperature.

When the temperature is going under 0 C, the curve is blank then become visible when temperature is positive.

How can i resolve this problem?

Thank you

Best Regards
Steve Shipway
2015-11-22 23:55:59 UTC
Permalink
rrdtool info templog.rrd
...
ds[internal].type = "GAUGE"
ds[internal].min = -1.0000000000e+01
ds[internal].max = 5.0000000000e+01
...
ds[external].type = "GAUGE"
ds[external].min = -2.0000000000e+01
ds[external].max = 5.0000000000e+01
OK, so your RRD file is correctly configured to allow from -20 to +50 as valid values for the internal/external DS.
sudo bash ./rrdtoolFetch.sh
internal external
1448221500: nan nan
1448221800: nan nan
1448222100: nan nan
1448222400: nan nan
1448222700: nan nan
1448223000: nan nan
1448223300: nan nan
1448223600: nan nan
1448223900: nan nan
1448224200: 2.1682617188e+01 9.7062734375e+00
1448224500: 2.1899166667e+01 9.8750000000e+00
1448224800: 2.2098750000e+01 9.0352300000e+00
1448225100: nan nan
So, your database holds values with internal between 21 and 23, and external between 9 and 10. All positive. The unknown values are before and after this.
From this, I would say your next step should be verifying your data collection and storage step.
When you collect this data and push it into the RRD, do you log any errors? Can you write a line of text to a log file like "Just retrieved value 19 and 9", and "Wrote values to RRD"? When you call "rrdtool update", are you logging any error output?

I have not seen the script you are using for collection and storage, so it may well be erroring and you don’t notice it.

Steve


Steve Shipway
T: +64 9 3737 599 ext 86487
E: ***@auckland.ac.nz
Simon Hobson
2015-11-23 08:03:47 UTC
Permalink
Post by Steve Shipway
OK, so your RRD file is correctly configured to allow from -20 to +50 as valid values for the internal/external DS.
Well something doesn't tie up then, the original question shows -55 to +125 as the allowed range.
Loading...