perl Sys::Uptime模块使用例子

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/usr/bin/perl -w
#author:shenxiaoran

use strict;
use Sys::Uptime;
my $nbrcpu = Sys::Uptime->cpunbr;
my @load   = Sys::Uptime->loadavg;
my $uptime = Sys::Uptime->uptime;
my $users  = Sys::Uptime->users;
print "CPU's installed:                $nbrcpu\n";
print "Load average (1min 5min 15min): @load\n";
print "Systems uptime (seconds):       $uptime\n";
print "Users logged on:                $users\n";