Load avg on BSD:

Michał Markowski says:
"uptime" output on OpenBSD and FreeBSD (so probably NetBSD and DragonflyBSD too) look similar to this:
 2:22PM  up 30 days, 13:44, 1 user, load averages: 0.06, 0.09, 0.13
This commit is contained in:
Ole Tange 2012-10-31 21:09:47 +01:00
parent 9e90477393
commit 00a2b4d119
2 changed files with 2 additions and 2 deletions

View file

@ -569,7 +569,7 @@ sub load_status_linux {
close IN;
} elsif (open(IN,"uptime|")) {
my $upString = <IN>;
if($upString =~ m/average.\s*(\d+\.\d+)/) {
if($upString =~ m/averages?.\s*(\d+\.\d+)/) {
$loadavg = $1;
} else {
::die_bug("uptime");

View file

@ -2395,7 +2395,7 @@ sub loadavg {
my $uptime_out = <$uptime_fh>;
close $uptime_fh;
# load average: 0.76, 1.53, 1.45
if($uptime_out =~ /load average: (\d+.\d+)/) {
if($uptime_out =~ /load averages?: (\d+.\d+)/) {
$self->{'loadavg'} = $1;
::debug("New loadavg: ".$self->{'loadavg'});
} else {