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

Karsten Siegmund karsten.siegmund at uni-ulm.de
Tue Mar 8 17:52:22 CET 2016


Hi,

for 1), I wrote a wrapper around the rrdtool command that fulfills the
task by first changing the destination from - (i.e. from stdout) to a
temporary file in /dev/shm/... and adding two PRINT statements for Min
and Max to the actual rrdtool call. It then parses the output of those
PRINT statements and either copies the image to stdout or nothing (for
Min=Max=0). 

((Not creating any output causes a "broken image" in the html page, for
which case standard solutions exist (in short: one can hide the parent
tag by default with style="display:none" and only unhide it if an image
was actually loaded successfully with <img onload=....> statements). ))

And yes... output from only rrds with real data in that timespan made
viewing so much more easy.

While the wrapper solves the problem, it is a bit of a hackish solution
(and only easily implemented for because final VDEF names in Ganglia are
always the same). 


As to 2), I found this post to the list from 2007
https://lists.oetiker.ch/pipermail/rrd-users/2007-September/013179.

I guess no further solution has been forthcoming for that problem since
2007?


Is the problem an unusual one that one has many graphs, but not all of
them are of interest (e.g. contain data!=0) for a certain timespan?


K.




On Mon, 2016-02-29 at 12:14 +0100, Karsten Siegmund wrote:
> Hi,
> 
> 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. 
> 
> Cheers,
> Karsten
> 
> 
> -------- 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
> 
> Hello,
> 
> 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
> STACK? 
> 
> 
> 
> The background:
> 
> 1) 
> 
> We are using Ganglia to monitor a cluster, which uses rrdtool commands
> like:
> 
> 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. 
> 
> =============
> 
> 2)
> 
> 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]
> DEF:'a0'='.../0/processes.rrd':'sum':AVERAGE
> DEF:'a1'='.../1/processes.rrd':'sum':AVERAGE
> [...]
> 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,
> Karsten
> 
> 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. 
> 
> 
> 
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

-- 
--
Dr. Karsten Siegmund
Universität Ulm
Raum O25/5208 
kiz / Abteilung Informationssysteme
Albert-Einstein-Allee 11
89081 Ulm, Germany
Tel. +49 731 5022465

-- Wenn bei meinem Gegenüber die sinnlosen Anglizismen überhand nehmen,
bin ich okkasional temptiert, den Dialog in similarer Faszion zu
kontinuieren.



More information about the rrd-users mailing list