[Xymon] obtaining maximum value to calculate percentage for graph

Jeremy Laidman jlaidman at rebel-it.com.au
Thu Aug 4 02:52:02 CEST 2016


(Forgot to cc the list)

On Thu, Aug 4, 2016 at 9:13 AM Jeremy Laidman <jlaidman at rebel-it.com.au>
wrote:

> On 4 Aug 2016 06:23, "Boldt, David" <dboldt at usgs.gov> wrote:
> >
> > I am monitoring a value for which I don't know the possible maximum,
> which I would like to express as a percentage.
>
> The maximum over what timescale? The graph width? All of time? Or the
> period of consolidation?
>
> > Expected to be able to do something like this (MAX should be a valid CF):
> >
> >         DEF:packets=fsth.rrd:freepackets:AVERAGE
> >         DEF:packetsMAX=fsth.rrd:freepackets:MAX
> >         CDEF:packetsPercent=packets,packetsMAX,/,100,*
> >
> > Alas the second line is not valid.
> >
> > What is the appropriate syntax for obtaining a maximum value?
>
> I'm not sure this would give you what you thought it would (if it worked).
> The MAX will be the maximum of all values that went to make up the
> consolidated value being graphed at that point only. For a graph showing
> every 5-minute sample individually, the max is the same as the average.
>
> I'm guessing you want the max over the graph width, so that you'll end up
> with one point at 100℅ and the rest usually lower (of course a flat line
> would have all points at 100℅).
>
> Have a look at VDEF. The purpose of VDEF is to consolidate all points over
> a region of time. Check out the man page for rrdgraph_data for an example
> using MAX.
>

And just by way of example, you can use a VDEF to show the peak of a graph
such as with this alternative [la] graph definition:

[la]
        TITLE CPU Load
        YAXIS Load
        DEF:avg=la.rrd:la:AVERAGE
        CDEF:la=avg,100,/
        AREA:la#00CC00:CPU Load Average
        -u 1.0
        GPRINT:la:LAST: \: %5.1lf (cur)
        GPRINT:la:MAX: \: %5.1lf (max)
        GPRINT:la:MIN: \: %5.1lf (min)
        GPRINT:la:AVERAGE: \: %5.1lf (avg)\n
        VDEF:laMax=la,MAXIMUM
        LINE:laMax#CC0000:Maximum
        GPRINT:laMax: \: %5.1lf\n

The only additions here are the last three lines.

Resultant graph:

[image: pasted1]

The red line will be at different levels over different timeframes, but
always with the same value as the largest point on the graph.

Once you have your VDEF variable defined like this, you can percentivise
your DEF or CDEF variable into it, and graph that instead (as an exercise
for the reader).

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20160804/d1f2ca6d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pasted1
Type: image/png
Size: 24282 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20160804/d1f2ca6d/attachment.png>


More information about the Xymon mailing list