How best to graph boolean values?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
paulcam
Posts: 4
Joined: Fri Aug 23, 2019 8:11 am

How best to graph boolean values?

Post by paulcam »

I use cacti to monitor a home heating system. With that I have several RRDs which have boolean values. These will be 0 or 1.

Now I can of course graph that and I get something like this:
Image
(I need help fixing the total minutes which is currently showing total seconds.)

But I was hoping I could show more than one on a graph maybe, or even better overlay them on a temperature graph as a transparent area.

For showing multiples, can I not multiply each 0 or 1 by 1, 2, 3, 4 and display them as an overlapped area plot. The downside would be if "2" was active and "1" not, then 1's area would be coloured with "2"'s colour if that makes sense.

For overlaying on existing graphs, if I set the multiplication factor to the max value on the graph and set the area to have transparency that should work, shouldn't it?
paulcam
Posts: 4
Joined: Fri Aug 23, 2019 8:11 am

Re: How best to graph boolean values?

Post by paulcam »

Also, as an aside, is there an easy way to duplicate a template or graph?

(Nevermind I found it in the list views "Choose action" drop down.)
paulcam
Posts: 4
Joined: Fri Aug 23, 2019 8:11 am

Re: How best to graph boolean values?

Post by paulcam »

So I managed to get something working:
Image

The light blue is the heating status, the light green is my "presence" at home.

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--pango-markup  \
--title='Ambient Temperatures with heating' \
--vertical-label='*C' \
--slope-mode \
--base=1000 \
--height=480 \
--width=1200 \
--right-axis '1:0' \
--right-axis-label '*C' \
--units-length '4' \
--tabwidth '30' \
--left-axis-formatter 'numeric' \
--alt-autoscale \
COMMENT:"From 2019/09/06 10\:49\:19 To 2019/09/07 10\:44\:19\c" \
COMMENT:"  \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border 1 --font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
--watermark 'Generated by Cacti' \
DEF:a='/home/pi/lcd_test/data/data_OD.rrd':'OD':AVERAGE \
DEF:b='/home/pi/lcd_test/data/data_LR.rrd':'LR':AVERAGE \
DEF:c='/home/pi/lcd_test/data/data_GR.rrd':'GR':AVERAGE \
DEF:d='/home/pi/lcd_test/data/data_BR.rrd':'BR':AVERAGE \
DEF:e='/home/pi/lcd_test/data/data_OF.rrd':'OF':AVERAGE \
DEF:f='/home/pi/lcd_test/data/data_OF.rrd':'OF':LAST \
DEF:g='/home/pi/lcd_test/data/data_HT.rrd':'HT':AVERAGE \
DEF:h='/home/pi/lcd_test/data/data_PR.rrd':'PR':AVERAGE \
CDEF:cdefzzcf='g,20,0,IF' \
CDEF:cdefcg='h,10,0,IF' \
LINE1:a#4444FFFF:'Outdoor    '  \
GPRINT:a:LAST:'Last\:%8.2lf %s'  \
GPRINT:a:AVERAGE:'Average\:%8.2lf %s'  \
GPRINT:a:MIN:'Min\:%8.2lf %s'  \
GPRINT:a:MAX:'Max\:%8.2lf %s\n'  \
LINE1:b#FF7D00FF:'Living Room'  \
GPRINT:b:LAST:'Last\:%8.2lf %s'  \
GPRINT:b:AVERAGE:'Average\:%8.2lf %s'  \
GPRINT:b:MIN:'Min\:%8.2lf %s'  \
GPRINT:b:MAX:'Max\:%8.2lf %s\n'  \
LINE1:c#96E78AFF:'Garage     '  \
GPRINT:c:LAST:'Last\:%8.2lf %s'  \
GPRINT:c:AVERAGE:'Average\:%8.2lf %s'  \
GPRINT:c:MIN:'Min\:%8.2lf %s'  \
GPRINT:c:MAX:'Max\:%8.2lf %s\n'  \
LINE1:d#ED5394FF:'Bedroom    '  \
GPRINT:d:LAST:'Last\:%8.2lf %s'  \
GPRINT:d:AVERAGE:'Average\:%8.2lf %s'  \
GPRINT:d:MIN:'Min\:%8.2lf %s'  \
GPRINT:d:MAX:'Max\:%8.2lf %s\n'  \
LINE1:e#817C4EFF:'Office     '  \
GPRINT:f:LAST:'Last\:%8.2lf %s'  \
GPRINT:e:AVERAGE:'Average\:%8.2lf %s'  \
GPRINT:e:MIN:'Min\:%8.2lf %s'  \
GPRINT:e:MAX:'Max\:%8.2lf %s\n'  \
AREA:cdefzzcf#AFECED66:  \
AREA:cdefcg#96E78A66: 
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: How best to graph boolean values?

Post by netniV »

that's pretty sweet. :)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest