Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2001 01:04:01 -0600 (CST)
From:      "Steve Kaczkowski" <operator@phreak.net>
To:        freebsd-isp@freebsd.org
Subject:   Re: How to get uptime?
Message-ID:  <14844.65.25.176.231.1007363041.squirrel@mail.phreak.net>
In-Reply-To: <20011202143626.N56385@squall.waterspout.com>
References:  <20011202143626.N56385@squall.waterspout.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Sun, Dec 02, 2001 at 08:12:14PM +0100, Thomas Krause, CI wrote:
>> ist there an other way to get the system uptime then the "uptime"
>> command? I need the uptime for a for a script which is called by mrtg.
>> The output of "uptime" is difficult to parse, eg:
> 
> Yes.  sysctl kern.boottime.  In C, you can get that via
>syctlbyname(), then get the current time w/ time(), then use
> difftime() to get the number of seconds difference.
> 

Here's some MRTG scripts that might be useful:

http://mrtg-pme.sourceforge.net/

Along with checking disk,paging,cpu,mem,etc they also display the uptime on 
the top of each page..

Good luck!


-- 
Steve Kaczkowski
operator@phreak.net


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14844.65.25.176.231.1007363041.squirrel>