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

2016-03-08 Thread Simon Hobson
Karsten Siegmund  wrote:

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

It would help if you didn't miss the html off the end ;-)

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

Probably so

> 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?

I suspect it's not sufficiently widespread and/or the people needing the 
feature are already working around it. Eg, if you are building your own CGI 
applications then it's not really much extra work to handle it then.
Or put another way, it's a known problem, but it's easily worked around - so 
not really much incentive to build anything better.

___
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


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

2016-03-08 Thread Karsten Siegmund
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  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@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-modeDEF:'sum'='/path/to/rrd:sum':AVERAGE
> AREA:'sum'#55:'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'\#E5:'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 

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

2016-02-29 Thread Karsten Siegmund

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@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-modeDEF:'sum'='/path/to/rrd:sum':AVERAGE
AREA:'sum'#55:'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'\#E5:'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@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users