List Info

Thread: unknown values




unknown values
user name
2006-08-16 22:31:54
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.

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.

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?

-- 
David Grohmann
Senior Student Associate
Applied Research Lab : UT Austin : ESL - S206
Office: 512-835-3237
Cell: 210-861-6882


--
Unsubscribe mailto:mrtg-requestlist.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

unknown values
user name
2006-08-16 22:48:31
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-requestlist.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

unknown values
user name
2006-08-16 23:34:09
Steve,

Is there a way in routers2 to have a UNKN shown as last
value and not a
grey area on the graphs??

I have several large printer farms that I monitor the toner
levels in,
looking for trends and rate of usage, but there are turned
off after
hours (reduce fire hazard) and it is ok to look at day or
week graphs,
but monthly is hard to read as most of the graph is grey.

I have looked through the docs and faq, but no luck or maybe
I just
can't read.

Sorry I know this is a routers2 question on the mrtg list,
but I am sure
I might not be the only person wondering this. 

More detail:
1 example-
Colour laser printer, 4 toners each are recorded as separate
target
using mrtg/rrdtool, then a user defined graph is used to
display all 4,
using:

routers.cgi*options[all4600toner]: integer nototal nodetails
noo


Cheers ... Ash 

Ashley Morrison, MCSE MCP DCE
Network Administrator
St. Michael's College
15 Mitton Ave
Henley Beach, SA, 5022
Ph: +61 8 8356 5966
Internet: www.smc.sa.edu.au

SAGE-AU Member
www.sage-au.org.au


-----Original Message-----
From: mrtg-bouncelist.ee.ethz.ch [mailto:mrtg-bouncelist.ee.ethz.ch]
On Behalf Of Steve Shipway
Sent: Thursday, 17 August 2006 8:19 AM
To: David Grohmann; mrtglist.ee.ethz.ch
Subject: [mrtg] Re: unknown values

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-requestlist.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

--
Unsubscribe mailto:mrtg-requestlist.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

unknown values
user name
2006-08-17 00:28:45
Hi David,

> [...] 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?

yes, write your targets like this

target[..]: 1:blaserv1 || 0 + 4:blaserv2 || 0

cheers
tobi

>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://tobi.oetiker.ch
tobioetiker.ch ++41 62 213 9907

--
Unsubscribe mailto:mrtg-requestlist.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

unknown values
user name
2006-08-17 01:57:44
Tobi Wrote:
>David Wrote:
> > Is there anyway to do this?
> 
> yes, write your targets like this
> target[..]: 1:blaserv1 || 0 + 4:blaserv2 || 0

Oh, I like that.  This must be a relatively new MRTG
ability, I don't
remember the || operator being there before.  I must take a
look at the
latest version docco and see what else has been added.

Steve

--
Unsubscribe mailto:mrtg-requestlist.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

unknown values
user name
2006-08-17 06:52:25
Hi Steve,

the reson this works is because mrtg sends the target lines
through
an eval pass after substituting the target expressions with
perl
variable names ... what it poils down to is, that you can
use any
perl code in a target line that does not look like a taret
itself
.. and you have to make sure that the target is separated
from the
rest of the code by whitespace ...

chers
tobi

ps this btw is not new, I just never bragged about it ...

Today Steve Shipway wrote:

> Tobi Wrote:
> >David Wrote:
> > > Is there anyway to do this?
> >
> > yes, write your targets like this
> > target[..]: 1:blaserv1 || 0 + 4:blaserv2 ||
0
>
> Oh, I like that.  This must be a relatively new MRTG
ability, I don't
> remember the || operator being there before.  I must
take a look at the
> latest version docco and see what else has been added.
>
> Steve
>
> --
> Unsubscribe mailto:mrtg-requestlist.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
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://tobi.oetiker.ch
tobioetiker.ch ++41 62 213 9907

--
Unsubscribe mailto:mrtg-requestlist.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

unknown values
user name
2006-08-17 15:28:31
Tobias Oetiker wrote:
> Hi David,
>
>   
>> [...] 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?
>>     
>
> yes, write your targets like this
>
> target[..]: 1:blaserv1 || 0 + 4:blaserv2 || 0
>
> cheers
> tobi
>
>   
Thanks a bunch! I will try this out!

-- 
David Grohmann
Senior Student Associate
Applied Research Lab : UT Austin : ESL - S206
Office: 512-835-3237
Cell: 210-861-6882



--
Unsubscribe mailto:mrtg-requestlist.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

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )