[rrd-users] [Fwd: Suppress graph output on on empty data (e.g. min=0, max=0)]

Karsten Siegmund karsten.siegmund at uni-ulm.de
Mon Feb 29 12:14:15 CET 2016


I sent this to the list a week ago, but as an oversight, hadn't
confirmed my registration to the list yet, so the mail got stuck in the
to-be-moderated loop. 
Not sure if/when that is being cleared, so I am re-sending now.
Apologies if this causes confusion. 


-------- Forwarded Message --------
To: rrd-users at lists.oetiker.ch
Subject: Suppress graph output on on empty data (e.g. min=0, max=0)
Date: Tue, 23 Feb 2016 18:23:12 +0100


as this mail became a bit lenghty, maybe I best prepend the question(s):

1) Can I suppress the output-png of an rrd that only contains the value
"0" for the respective timespan - or maybe even better output a
dummy-png with width=1 and height=1?

2) Can I do the same (i.e. suppress the key if e.g. min=max=0) in a

The background:


We are using Ganglia to monitor a cluster, which uses rrdtool commands

rrdtool graph - --start '-28800s' --end now --width 400 --height 100
--slope-mode    DEF:'sum'='/path/to/rrd:sum':AVERAGE
AREA:'sum'#555555:'load_one last 8hr   ' CDEF:sum_pos=sum,0,LT,0,sum,IF
VDEF:sum_last=sum_pos,LAST VDEF:sum_min=sum_pos,MINIMUM
VDEF:sum_avg=sum_pos,AVERAGE VDEF:sum_max=sum_pos,MAXIMUM
GPRINT:'sum_last':'Now\:%7.2lf%s' #further GPRINT  removed.

So the PNG is written to stdout directly and piped to the network
connection with the user's browser. 

There are about ~500 compute-nodes that are monitored, for which a
single metric (or a report that combines several metrics) is plotted at
once on one web-page, giving a visual overview. 

For some metrics, all values may turn out to be "0" for the whole
graphed timespan for a lot of the nodes, e.g. used diskspace in the
ramdisk or the local disks (because jobs will only use one of them or
even need none). So one may end up with 400 graphics which show an empty
plot and 100 interesting ones that contain data. 

The page would be much more useful, if only the graphs containing actual
data are shown. The only way to do this I can right now imagine is to do
two rrdtool calls. The first only does  
PRINT:'sum_min':'%.0lf%s' PRINT:'sum_max':'%.0lf%s'
this is then compared against 0\n0 and only then the graph is plotted
with the 2nd command. 

This approach would double the amount of rrdtool calls when every rrd
contains data !=0. This isn't ideal for a big number of RRDs, so I
wonder if there is a simpler and more efficient way to do this within a
single call. 



There is also a stacked graph in Ganglia, which shows a stack of one
metric with the values from all nodes.
so, part of the command is e.g.
[... more options]
AREA:'a0'\#E50000:'0    ' 
STACK:'a1'\#E53400:'1    '

here it would be useful to suppress printing the key of any rrd that
contributes "0" to the stack over the whole timespan, but again I can
only imagine excluding RRDs from the stack by processing them with PRINT
before assembling the stack (if an area with size 0 is added to the
stack is of course inconsequential for the resulting graph anyway). 
Is there some option/trick that would suppress the key for empty
datasets in that time range? 

Thank you and best regards,

PS. I am not a Ganglia developer, but it's written in PHP, so if there
are some capabilities in rrdtool that enable to do this, it wouldn't be
too hard to add some options. If there is a good solution to the
problem, I would try to suggest its inclusion in Ganglia. 

More information about the rrd-users mailing list