Rrdtool graph: Difference between revisions

From I Will Fear No Evil
Jump to navigation Jump to search
(Created page with "==== RRDtool Graph examples ==== This seems to be the biggest PITA to deal with. There are simply too many options and they are VERY sensitive to n00bs. This works (but looks like crap since I am learning) <pre> rrdtool graph ${DEST} --width 500 --height 100 --title "temp and humidity (2 hour resolution)" \ --font AXIS:8: \ --font LEGEND:8: \ --font UNIT:8: \ --x-grid MINUTE:30:HOUR:2:HOUR:2:0:"%I%p" \ DEF:ds0=/opt/nmsApi/rrd/database.rrd:temperature:AVERAG...")
 
Line 21: Line 21:
</pre>
</pre>


Adding a line like a threshold value is done with the HRULE
* Value 50 will show up in the legend
<pre>
HRULE:50#FF0000:"Value 50"
</pre>
[[Category:rrd]]
[[Category:rrd]]

Revision as of 19:44, 28 May 2023

RRDtool Graph examples

This seems to be the biggest PITA to deal with. There are simply too many options and they are VERY sensitive to n00bs.

This works (but looks like crap since I am learning)

rrdtool graph ${DEST}  --width 500 --height 100 --title "temp and humidity (2 hour resolution)" \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
--x-grid MINUTE:30:HOUR:2:HOUR:2:0:"%I%p" \
           DEF:ds0=/opt/nmsApi/rrd/database.rrd:temperature:AVERAGE \
           DEF:ds0max=/opt/nmsApi/rrd/database.rrd:temperature:MAX \
           DEF:ds0min=/opt/nmsApi/rrd/database.rrd:temperature:MIN \
           DEF:ds1=/opt/nmsApi/rrd/database.rrd:humidity:AVERAGE \
           DEF:ds1max=/opt/nmsApi/rrd/database.rrd:humidity:MAX \
           DEF:ds1min=/opt/nmsApi/rrd/database.rrd:humidity:MIN \
           COMMENT:'BLAH                  ' COMMENT:' Last ' COMMENT:' Avg ' COMMENT:' Min ' COMMENT:' Max ' COMMENT:'\l' \
           LINE1.25:ds0#00cc00:'temperature ' GPRINT:ds0:LAST:%5.1lf%s GPRINT:ds0:AVERAGE:%5.1lf%s GPRINT:ds0min:MIN:%5.1lf%s GPRINT:ds0max:MAX:%5.1lf%s COMMENT:'\l' \
           LINE3.25:ds1#0000ff:'humidity ' GPRINT:ds1:LAST:%5.1lf%s GPRINT:ds1:AVERAGE:%5.1lf%s GPRINT:ds1min:MIN:%5.1lf%s GPRINT:ds1max:MAX:%5.1lf%s COMMENT:'\l'

Adding a line like a threshold value is done with the HRULE

  • Value 50 will show up in the legend
HRULE:50#FF0000:"Value 50"