[rrd-users] multiple stack graph

Simon Hobson linux at thehobsons.co.uk
Mon Aug 23 11:46:31 CEST 2010


James Nunnerley wrote:

>>That should work, but it might help just a teensie bit if you gave
>>some clue as to the meaning of "not working" ! Does it mean you get a
>>plot but it doesn't look like you expect, or nothing happens, or you
>>get an error, or ... ?
<snip>
>>/usr/bin/rrdtool graph /var/www/graphs/192.168.43.254.disk-day.png
>>-s -1day -a PNG -i -z --alt-y-grid -h 125 -l 0 -u 100 -r \
>>--color SHADEA#EAE9EE --color SHADEB#EAE9EE --color BACK#EAE9EE
>>--vertical-label "partition used %" -t "Disk usage" -b 1024 \
>>
>>DEF:used1=/etc/rrdtool/192.168.43.254.disk.rrd:used:AVERAGE
>>DEF:avail1=/etc/rrdtool/192.168.43.254.disk.rrd:avail:AVERAGE \
>>DEF:used2=/etc/rrdtool/192.168.43.254.disk1.rrd:used:AVERAGE
>>DEF:avail2=/etc/rrdtool/192.168.43.254.disk1.rrd:avail:AVERAGE \
>>
>>CDEF:total1=used1,avail1,+
>>CDEF:usedpct1=100,used1,total1,/,*
>>CDEF:availpct1=100,avail1,total1,/,*
>>
>>AREA:usedpct1#4169E1:"used disk" \
>>STACK:availpct1#32CD32:"free disk"\\j
>>
>>CDEF:MBavail1=avail1,1048576,*
>>CDEF:MBused1=used1,1048576,*
>>CDEF:MBtotal1=total1,1048576,* \
>>
>>CDEF:total2=used2,avail2,+
>>CDEF:usedpct2=100,used2,total2,/,*
>>CDEF:availpct2=100,avail2,total2,/,*
>>CDEF:usedpct2neg=0,usedpct2,- \
>>CDEF:availpct2neg=0,availpct2,-
>>
>>AREA:usedpct2neg#4169E1:"used disk"
>>STACK:availpct2neg#32CD32:"free disk"\\j \
>>
>>CDEF:MBavail2=avail2,1048576,*
>>CDEF:MBused2=used2,1048576,*
>>CDEF:MBtotal2=total2,1048576,* \

>Sorry I should have explained... it's basically not showing the 
>second lot of data.  It shows it at the bottom in the data table, 
>but not on the graph...

So the legend shows all the right values, but the graph itself 
doesn't show anything ?

A couple of ideas :

1) try substituting fixed numbers, eg
CDEF:usedpct2neg=0,usedpct2,*,50,-
CDEF:availpct2neg=0,availpct2,*,50,-

2) try a different formula, eg
CDEF:usedpct2neg=usedpct2,-1,*
CDEF:availpct2neg=availpct2,-1,*

See if either make a difference.

Hmm, takes another look and consults the docs ...

But before doing that, you may want to take a look at your Y axis 
scaling options :
  -l 0 -u 100 -r
Which as I read it, means scale from 0 to 100, rigidly. So the Y axis 
won't extend to negative numbers. Changing to -l -100 ought to fix it.


-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the rrd-users mailing list