[mrtg] Re: unknown values
Steve Shipway
s.shipway at auckland.ac.nz
Thu Aug 17 00:48:31 MEST 2006
David Grohmann wrote:
> I understand the MRTG has 2 ways of dealing with unknowns.
> The default is to assume the previous value, and the other
> option is to assume zero.
Technically, what happens is that if the unknaszero option is set then a
0 is stored in the database, otherwise an UNKN is stored. The non-rrd
MRTG will display an UNKN as the previous value, as will 14all.cgi.
routers2.cgi displays an UNKN as a grey bar, unless unknaszero is set in
which case it is displayed as zero. I'm not sure what mrtg-rrd.cgi
does.
> However, while computing a large expression from different
> hosts, specifically an average in my case. If any of the
> values in the expression or unknown then the whole target
> reverts to either zero or flat line.
This is because any expression containing an unknown gives an unknown.
routers.cgi gets around this in userdefined graphs by making totals and
averages be over all non-unknown values, unless unknaszero is set in
which case they are treated as zero.
> For example, I'm trying to get the average cpu usage in a
> room (among many other averages ram usage, disk usage,
> network throughput), if host A goes offline for whatever
> reason I would prefer that the calculation go on assuming
> that Host A's cpu usage is zero(or use the previous value of
> host A's cpu usage) and have the calculated target still give
> out a meaningful value instead of it reverting to zero or the
> previous value of the target.
>
> Is there anyway to do this?
You can do this with routers2, by defineing all the various host
targets, then defining a userdefined graph with average line over the
top of the multiple targets. Here, I use this to give average webserver
activities over all the active hosts in the web farm, for example.
To do this in a single MRTG target, you will need to write a wrapper
script yourself that retrieves the data and does the average calculation
taking into account the unknowns.
Of course I'm biased in promoting routers2 as a universal panacea,
though...
Steve
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://lists.ee.ethz.ch/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the mrtg
mailing list