[mrtg] Re: hrSystemUptime

Jerry Heidtke jheidtke at fmlh.edu
Wed Feb 19 17:36:59 MET 2003


I'm not sure I completely understand it, but I did a little investigation.  

BER.pm is one of the snmp libraries for perl written by Simon Leinen that
mrtg uses. It is responsible for encoding snmp requests, and decoding snmp
responses.

In BER.pm there is a line that says:

$pretty_print_timeticks = 1;

If you change this to:

$pretty_print_timeticks = 0;

Then BER.pm won't translate timeticks responses to "xx days, hh:mm:ss.ss"
format. The response will be returned to the calling application (in this
case mrtg) as an integer representing the number of hundredths of a second
that the system has been up. This affects all of the timeticks values
accessed through BER.pm.

There's probably a way to set this as some kind of global variable or
environment setting without editing the library directly. Some perl guru,
which I'm not, will have to explain this.

As someone else pointed out, this value will wrap around to zero every 497
days. This could be a data interpretation problem if you're tracking a
system that never gets rebooted.

If you change this to "0" you can call the oid directly from mrtg and get an
integer back that can be graphed. Hoever, you would probably want to graph a
value like minutes or hours instead of hundredths of a second. Minutes would
have a range of 0 - 715,828. You'd have to divide the target by 6000 for
this result. Hours would have a range of 0 - 11,930. You'd have to divide
the target by 360000 for this result. Example (for minutes):

Target[xyz]: .1.3.6.1.2.1.25.1.1.0 at .1.3.6.1.2.1.25.1.1.0:community at host /
6000

Jerry



-----Original Message-----
From: Antoine Jacoutot [mailto:ajacoutot at lphp.org] 
Sent: Tuesday, February 18, 2003 5:26 PM
To: McDonald, Dan; 'Jerry Heidtke'
Cc: Mrtg (E-mail)
Subject: Re: [mrtg] Re: hrSystemUptime


On Tuesday 18 February 2003 22:46, McDonald, Dan wrote:
> It's actually much easier than that.  You just need to set
> $BER::pretty_print_timeticks=0 and everything will be fine.

I'm not sure I understand that...

Antoine


Confidentiality Notice: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and may contain confidential 
and privileged information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.


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