diff options
| author | Paul Buetow <paul@buetow.org> | 2011-01-17 22:07:15 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2011-01-17 22:07:15 +0000 |
| commit | 21f71970697f0cb792116ebbcd4ff6b8a275018d (patch) | |
| tree | ca87b43e93e3fe32bbc3b5d160e4e62f40599a9a /loadbars.pl | |
| parent | 9caed2297b2050e820f5f5f8eba39eb0b76bced8 (diff) | |
load avg now inside if
Diffstat (limited to 'loadbars.pl')
| -rwxr-xr-x | loadbars.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/loadbars.pl b/loadbars.pl index 0701169..59f77ab 100755 --- a/loadbars.pl +++ b/loadbars.pl @@ -318,7 +318,6 @@ sub thr_display_stats () { shift @{$last_loads{$key}} while @{$last_loads{$key}} >= $CONF{average}; my %cpuaverage = get_cpuaverage $factor, @{$last_loads{$key}}; - my @loadavg = split ';', $AVGSTATS{$host}; my %heights = map { $_ => defined $cpuaverage{$_} ? $cpuaverage{$_} * ($CONF{height}/100) : 1 @@ -375,6 +374,8 @@ sub thr_display_stats () { $app->print($x, 65, sprintf "%d%s", $system_n_user, 'su'); unless (exists $avg_display{$host}) { + my @loadavg = split ';', $AVGSTATS{$host}; + $app->print($x, 85, 'avg:'); $app->print($x, 105, sprintf "%.2f", $loadavg[0]); $app->print($x, 125, sprintf "%.2f", $loadavg[1]); |
