[mrtg] Re: Problem with MRTG 2.9.10 log file and decimals
Grendel
grendel at interq.ad.jp
Wed Apr 4 01:52:07 MEST 2001
Hi,
This is how rateup deals with decimals passed to it by the mrtg Perl
executable. To get around this, you need to edit the mrtg Perl
executable itself and find the right place to tell it to round any
numbers it finds. I've attached the patch I wrote up on a Solaris
install of the same version. I generated it in accordnce with the
contribution guidelines on the MRTG homepage. Even if you're clear on
how to apply it, it includes a longer explanation and hints at the top
and bottom as to where it belongs, so you should be able to add the
necessary lines manually. I rounded according to how I was once taught,
but you can just drop the integer portion instead, whatever suits you
best. The key is finding the right place to do it.
Best regards,
James Overvbeck
GMO - http://www.gmo.co.jp/
Tokyo, Japan
Chris Thomas wrote:
>
> I am having a problem with decimal values in the MRTG log file and hope one
> of you gurus can tell me what I am doing wrong.
>
> I am running traditional MRTG 2.9.10 under Windows NT 4 (SP6), and my Perl
> is Active's 5.005_03. I am attempting to monitor the temperature of a
> Cisco 6509. When I use the Celisus values directly from the 6509,
> everything works just fine, and as I expect.
>
> However, when I attempt to convert the values to from C to F by appending
> to the Target[] line * 1.8 + 32, I have a problem. When I use * 9 / 5 +
> 32, I have the same problem. When I use * 2 + 32, the problem goes away
> (but I don't get the correct temperature, obviously).
>
> The problem seems to be related to the fact that * 1.8 results in a
> fractional value. For example, 28C = 82.4F. This seems to fail the
> MaxBytes compare, and the value is considered invalid and not entered in
> the log file. The log file instead propagates the last good value (default
> behavior), in this case 0. Can anyone tell me what I'm doing wrong, or how
> to fix it.
>
> log file:
>
> 986327405 80.6 109.4
> 986327405 0 0 0 0
> 986327107 0 0 0 0
> 986327100 0 0 0 0
> 986326800 0 0 0 0
> 986326500 0 0 0 0
>
> mrtg.cfg
>
> Target[6509temp1]:
> 1.3.6.1.4.1.9.9.91.1.1.1.1.4.4001&1.3.6.1.4.1.9.9.91.1.1.1.1.4.4002:public at 128.97.232.102
> * 1.8 + 32
> RouterUptime[6509temp1]: public at 128.97.232.102
> YLegend[6509temp1]: Degrees F
> ShortLegend[6509temp1]: °F
> MaxBytes[6509temp1]: 160
> Options[6509temp1]: nopercent, growright, gauge
> Unscaled[6509temp1]: dwmy
> AbsMax[6509temp1]: 160
> Title[6509temp1]: 6509temp1
> Legend1[6509temp1]: Average 5 minute Inlet Temp - Slot 2
> Legend2[6509temp1]: Average 5 minute Outlet Temp - Slot 2
> LegendI[6509temp1]: Inlet:
> LegendO[6509temp1]: Outlet:
> PageTop[6509temp1]: <H1> 6509 Temperature (Slot 2) - Degrees F
> <BR></H1>
> <TABLE>
> <TR><TD>System:</TD><TD>Cisco 6509</TD></TR>
> <TR><TD>Maintainer:</TD><TD>Chris Thomas</TD></TR>
> </TABLE>
>
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive http://www.ee.ethz.ch/~slist/mrtg
> FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
> WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
-- Attached file removed by Listar and put at URL below --
-- Type: text/plain
-- Size: 1k (1910 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/mrtg-patch.txt
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list