NAME
Unix::Uptime - Determine the current uptime, in seconds, across different *NIX architectures
SYNOPSIS
use Unix::Uptime;
my $uptime = Unix::Uptime->uptime();
DESCRIPTION
This is a rather simple module that abstracts the task of figuring out the current system uptime, in seconds. It was born out of a desire to do this on non-Linux systems, without SNMP. If you want to use SNMP, there are pleanty of modules on CPAN already.
Currently, this module just supports getting the uptime on Linux and FreeBSD. It should be easy enough to add support for other operating systems, though.
METHODS
The following static (class) methods are available:
uptime()
This takes no arguments, and simply returns the number of seconds this system has been running. Depending on the operating system, this could be a whole integer, or a floating point number.
SEE ALSO
Sys::Load(3) and Sys::Uptime(3) for Linux-specific implementations.
Win32::Uptime for Win32.
BUGS
This currently doesn't support more than Linux and FreeBSD. Contributions for other operating systems would be welcome.
AUTHOR
Mike Kelly <pioto@pioto.org>
COPYRIGHT AND LICENSE
Copyright 2008 Mike Kelly
Distributed under the same terms as Perl itself. See http://dev.perl.org/licenses/ for more information.