[mrtg] Re: hrSystemUptime
Jerry Heidtke
jheidtke at fmlh.edu
Tue Feb 18 22:38:03 MET 2003
The problem is that querying hrSystemUptime.0 (or any other OID that has the
format timeticks) from mrtg returns data that looks like "12 days,
4:23:18.91", not like 105259891, which mrtg could make sense of. To graph
hrSystemUptime, you need to call a script that will retrieve the value and
convert it to an integer, like minutes, that mrtg can handle.
I use the following script to do something similar with APC UPS runtimes,
which are also timeticks. This is based on something in the mrtg contrib
directory, but modified to use only perl functions for snmp rather than a
system call to an external executable. It could easily be adapted to return
hrSystemUptime formatted as integer minutes, hours, whatever. This script
only converts hours and minutes, something that graphs hrSystemUptime would
have to include the days in the calculation.
Jerry
#!d:\perl\bin\perl
#
# Script to convert runtime MIB variable for UPS into minutes
# eg. perl upsdata01.pl snmp-community at host-addr
# returns runtimt in minutes and load percentage
#
require 5.005;
use strict;
use SNMP_util "0.77";
my @a = snmpget($ARGV[0], "enterprises.318.1.1.1.2.2.3.0");
my @b=split(/:/, at a[0]);
my @c= snmpget($ARGV[0], "enterprises.318.1.1.1.4.2.3.0");
print eval($b[0] * 60 + $b[1]),"\n";
print @c[0],"\n";
-----Original Message-----
From: McDonald, Dan [mailto:Dan.McDonald at austinenergy.com]
Sent: Tuesday, February 18, 2003 3:05 PM
To: 'Antoine Jacoutot'
Cc: Mrtg (E-mail)
Subject: [mrtg] Re: hrSystemUptime
In an mrtg config file do something like:
loadmibs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.my
target[uptime]: hrSystemUptime.0&hrSystemUptime.0:public at localhost:::::2
and all of the other entries that you need for a good looking entry...
Daniel J McDonald, CCIE #2495, CNX
Lan/Wan Integrator
Austin Energy
1.512.322.6739
dan.mcdonald at austinenergy.com
-----Original Message-----
From: Antoine Jacoutot [mailto:ajacoutot at lphp.org]
Sent: Tuesday, February 18, 2003 2:27 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] hrSystemUptime
Hi !
I "googled" all the afternoon but could find any valid nor working answer to
my question:
how is it possible to tell mrtg to use hrSystemUptime for monitoring system
uptime ?
On a console, if I go:
# snmpget -v 2c -c public localhost host.hrSystem.hrSystemUptime.0
I get:
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (105259891) 12 days,
4:23:18.91
But I have no idea how to tell mrtg to use this.
Thanks.
Antoine
--
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
--
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
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