0

I've created quite a few RRDTool graphs monitoring various aspects of a Raspberry Pi server.

I'm displaying 36 hours, 10 days, 45 days and 18 months for things like transferred data, CPU temperature, load averages etc.

However, the only "continuous" looking graphs are the 10-day graphs, all the others have gaps in them. I'm recording each data point at a minutely interval.

There are 28 (29) images, so I'm not going to put them all here, so I've put them on imgur for your perusal

But here's an example of what I'm talking about:

10-days works fine!

enter image description here

45-days, not so much.

enter image description here

Here's my .rrd creation script:

rrdtool create data.rrd         \
--start N --step '60'           \
'DS:rx:GAUGE:60:0:U'            \
'DS:tx:GAUGE:60:0:U'            \
'DS:rxc:COUNTER:60:0:U'         \
'DS:txc:COUNTER:60:0:U'         \
'DS:wrx:GAUGE:60:0:U'           \
'DS:wtx:GAUGE:60:0:U'           \
'DS:wrxc:COUNTER:60:0:U'        \
'DS:wtxc:COUNTER:60:0:U'        \
'RRA:AVERAGE:0.5:1:129600'      \
'RRA:AVERAGE:0.5:2:64800'       \
'RRA:AVERAGE:0.5:60:14400'      \
'RRA:AVERAGE:0.5:300:12960'     \
'RRA:AVERAGE:0.5:3600:13140'    

rrdtool create load.rrd         \
--start N                       \
--step '60'                     \
'DS:load:GAUGE:60:0:4'          \
'RRA:AVERAGE:0.5:1:129600'      \
'RRA:AVERAGE:0.5:2:64800'       \
'RRA:AVERAGE:0.5:60:14400'      \
'RRA:AVERAGE:0.5:300:12960'     \
'RRA:AVERAGE:0.5:3600:13140'    

rrdtool create mem.rrd          \
--start N                       \
--step '60'                     \
'DS:mem:GAUGE:60:0:100'         \
'RRA:AVERAGE:0.5:1:129600'      \
'RRA:AVERAGE:0.5:2:64800'       \
'RRA:AVERAGE:0.5:60:14400'      \
'RRA:AVERAGE:0.5:300:12960'     \
'RRA:AVERAGE:0.5:3600:13140'    

rrdtool create pitemp.rrd       \
--start N                       \
--step '60'                     \
'DS:pitemp:GAUGE:60:U:U'        \
'RRA:AVERAGE:0.5:1:129600'      \
'RRA:AVERAGE:0.5:2:64800'       \
'RRA:AVERAGE:0.5:60:14400'      \
'RRA:AVERAGE:0.5:300:12960'     \
'RRA:AVERAGE:0.5:3600:13140'    

My entire draw script is like over 900 lines long, so I'll just include the actual draw code here for one set of graphs ($RRDTOOL is a variable containing the path /usr/bin/rrdtool):

$RRDTOOL graph /var/www/html/images/graphs/data36h.png                  \
--title 'Odin Absolute Traffic (eth0)'                                  \
--watermark "Graph Drawn `date`"                                        \
--vertical-label 'Bytes'                                                \
--lower-limit '0'                                                       \
--rigid                                                                 \
--alt-autoscale                                                         \
--units=si                                                              \
--width '640'                                                           \
--height '300'                                                          \
--full-size-mode                                                        \
--start end-36h                                                         \
'DEF:rx=/usr/local/bin/system/data.rrd:rx:AVERAGE'                      \
'CDEF:cleanrx=rx,UN,PREV,rx,IF'                                         \
'DEF:tx=/usr/local/bin/system/data.rrd:tx:AVERAGE'                      \
'AREA:rx#00CC00FF:Download\:'                                           \
'GPRINT:rx:LAST:\:%8.2lf %s]'                                           \
'STACK:tx#0000FFFF:Upload\:'                                            \
'GPRINT:tx:LAST:\:%8.2lf %s]\n'

$RRDTOOL graph /var/www/html/images/graphs/data10d.png                  \
--title 'Odin Absolute Traffic (eth0) 10 days'                          \
--watermark "Graph Drawn `date`"                                        \
--vertical-label 'Bytes'                                                \
--lower-limit '0'                                                       \
--rigid                                                                 \
--alt-autoscale                                                         \
--units=si                                                              \
--width '640'                                                           \
--height '300'                                                          \
--full-size-mode                                                        \
--start end-10d                                                         \
'DEF:rx=/usr/local/bin/system/data.rrd:rx:AVERAGE'                      \
'DEF:tx=/usr/local/bin/system/data.rrd:tx:AVERAGE'                      \
'AREA:rx#00CC00FF:Download\:'                                           \
'GPRINT:rx:LAST:\:%8.2lf %s]'                                           \
'STACK:tx#0000FFFF:Upload\:'                                            \
'GPRINT:tx:LAST:\:%8.2lf %s]\n'

$RRDTOOL graph /var/www/html/images/graphs/data45d.png                  \
--title 'Odin Absolute Traffic (eth0) 45 days'                          \
--watermark "Graph Drawn `date`"                                        \
--vertical-label 'Bytes'                                                \
--lower-limit '0'                                                       \
--rigid                                                                 \
--alt-autoscale                                                         \
--units=si                                                              \
--width '640'                                                           \
--height '300'                                                          \
--full-size-mode                                                        \
--start end-45d                                                         \
'DEF:rx=/usr/local/bin/system/data.rrd:rx:AVERAGE'                      \
'DEF:tx=/usr/local/bin/system/data.rrd:tx:AVERAGE'                      \
'AREA:rx#00CC00FF:Download\:'                                           \
'GPRINT:rx:LAST:\:%8.2lf %s]'                                           \
'STACK:tx#0000FFFF:Upload\:'                                            \

$RRDTOOL graph /var/www/html/images/graphs/data18m.png                  \
--title 'Odin Absolute Traffic (eth0) 18 month'                         \
--watermark "Graph Drawn `date`"                                        \
--vertical-label 'Bytes'                                                \
--lower-limit '0'                                                       \
--rigid                                                                 \
--alt-autoscale                                                         \
--units=si                                                              \
--width '640'                                                           \
--height '300'                                                          \
--full-size-mode                                                        \
--start end-1y6m                                                        \
'DEF:rx=/usr/local/bin/system/data.rrd:rx:AVERAGE'                      \
'DEF:tx=/usr/local/bin/system/data.rrd:tx:AVERAGE'                      \
'AREA:rx#00CC00FF:Download\:'                                           \
'GPRINT:rx:LAST:\:%8.2lf %s]'                                           \
'STACK:tx#0000FFFF:Upload\:'  

And yes, I know that the title on one of the graphs is wrong, I've fixed that, but only after saving all the images to imgur.

Jim
  • 2,243
  • 2
  • 13
  • 17

1 Answers1

1

If you choose a --step of 60 seconds, I would choose a mrhb of 120s and not also of 60s because rrdtool will disregard any updates that are more than 60s apart.

rrdtool create data.rrd         \
--start N --step '60'           \
'DS:rx:GAUGE:120:0:U'            \
'DS:tx:GAUGE:120:0:U'            \
'DS:rxc:COUNTER:120:0:U'         \
'DS:txc:COUNTER:120:0:U'         \
'DS:wrx:GAUGE:120:0:U'           \
'DS:wtx:GAUGE:120:0:U'           \
'DS:wrxc:COUNTER:120:0:U'        \
'DS:wtxc:COUNTER:120:0:U'        \
'RRA:AVERAGE:0.5:1:129600'      \
'RRA:AVERAGE:0.5:2:64800'       \
'RRA:AVERAGE:0.5:60:14400'      \
'RRA:AVERAGE:0.5:300:12960'     \
'RRA:AVERAGE:0.5:3600:13140'    
Tobi Oetiker
  • 5,167
  • 2
  • 17
  • 23
  • Wow, the man himself! Thanks Tobi. I'll re-create the `.rrd`s with a longer heartbeat as you recommend. and give it a shot. I'll let it run for a few weeks to determine if it works. – Jim Aug 03 '16 at 19:31
  • Maybe also increase the xff in the RRA definitions to a higher value. The default of 0.5 is usually fine, but if you're getting some unpopulated datapoints then you could be getting unknowns. Maybe raise it to 0.75 and see if this helps. Your graphs are probably using the 60-size RRA so this might make a difference. – Steve Shipway Aug 03 '16 at 21:08
  • I've been running the 120s heartbeat and it's already looking much better, the top of the `Odin Absolute Traffic (eth0)` graph has no more "jitter"... never understood why an ever increasing amount would have tiny reductions, but that's now been eliminated. I'll keep an eye on the graphs and mark this as correct in a few days. – Jim Aug 04 '16 at 15:26
  • the reason for this effect is, that you have configured the rras such that they require 50% of the base data to be known ... or the rra entry goes unknown – Tobi Oetiker Aug 05 '16 at 05:57