summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (venus) <paul@buetow.org>2012-01-21 15:35:17 +0100
committerPaul Buetow (venus) <paul@buetow.org>2012-01-21 15:35:17 +0100
commitb37b9c5ad9cf998333f7c3b972b3c439ca9a83e6 (patch)
tree61108da531e2a346dd793c335ba536b0eca18b12
parentb82925d672d579ab94a0f4b2056d308afe442e7c (diff)
no default to localhost
-rw-r--r--BUGS1
-rw-r--r--README4
-rwxr-xr-xloadbars44
3 files changed, 26 insertions, 23 deletions
diff --git a/BUGS b/BUGS
index 6dae86e..4f27f4b 100644
--- a/BUGS
+++ b/BUGS
@@ -1,2 +1 @@
-* Status messages sometimes have black vertical lines in between
* After quit ssh processes dont shut down instantly but later
diff --git a/README b/README
index 37d7954..31c278b 100644
--- a/README
+++ b/README
@@ -35,7 +35,7 @@ Explanations:
Color: White
ni = Nice cpu usage in %
Color: Green
- io = IOwait cpu sage in % (extended)
+ io = IOwait cpu sage in %
Color: Purple
us = User cpu usage in %
Color: Yellow, dark yellow if al>50%, orange if al>50%
@@ -43,6 +43,6 @@ Explanations:
Blue, purple if >30%
al = 100% minus id
pk = Max al peak of last avg. samples (extended)
- avg = System load average; desc. order: 1, 5 and 15 min. avg. (extended)
+ avg = System load average; desc. order: 1, 5 and 15 min. avg.
1px horizontal line: Maximum sy+us+io of last 'avg' samples (extended)
(extended) means: text display only if extended mode is turned on
diff --git a/loadbars b/loadbars
index e8bb3a1..1c692a1 100755
--- a/loadbars
+++ b/loadbars
@@ -68,7 +68,6 @@ my %C : shared;
extended => 0,
displaytxt => 1,
displaytxthost => 0,
- extended => 1,
inter => 0.1,
samples => 1000,
sshopts => '',
@@ -517,27 +516,29 @@ sub main_loop ($@) {
}
$app->print($x, $y+=$space, sprintf '%02d%s', norm $cpuaverage->{nice}, 'ni');
- $app->print($x, $y+=$space, sprintf '%02d%s', norm $cpuaverage->{iowait}, 'io') if $C{extended};
+ $app->print($x, $y+=$space, sprintf '%02d%s', norm $cpuaverage->{iowait}, 'io');
$app->print($x, $y+=$space, sprintf '%02d%s', norm $cpuaverage->{user}, 'us');
$app->print($x, $y+=$space, sprintf '%02d%s', norm $cpuaverage->{system}, 'sy');
$app->print($x, $y+=$space, sprintf '%02d%s', norm $all, 'al');
- if ($C{extended}) {
- $app->print($x, $y+=$space, sprintf '%02d%s', norm $max_all, 'pk');
+ $app->print($x, $y+=$space, sprintf '%02d%s', norm $max_all, 'pk') if $C{extended};
- unless ($is_host_summary) {
- if (defined $loadavg[0]) {
- $app->print($x, $y+=$space, 'avg:');
- $app->print($x, $y+=$space, sprintf "%.2f", $loadavg[0]);
- $app->print($x, $y+=$space, sprintf "%.2f", $loadavg[1]);
- $app->print($x, $y+=$space, sprintf "%.2f", $loadavg[2]);
- }
- }
+ unless ($is_host_summary) {
+ if (defined $loadavg[0]) {
+ $app->print($x, $y+=$space, 'avg:');
+ $app->print($x, $y+=$space, sprintf "%.2f", $loadavg[0]);
+ $app->print($x, $y+=$space, sprintf "%.2f", $loadavg[1]);
+ $app->print($x, $y+=$space, sprintf "%.2f", $loadavg[2]);
+ }
}
}
# Display an informational text message if any
- $app->print(0, $y+=$space, $displayinfo) if length $displayinfo;
+ #$app->print(0, $y+=$space, $displayinfo) if length $displayinfo;
+ if (length $displayinfo) {
+ say $displayinfo;
+ $displayinfo = '';
+ }
$app->update(
$rect_nice,
@@ -607,7 +608,7 @@ Explanations:
Color: White
ni = Nice cpu usage in %
Color: Green
- io = IOwait cpu sage in % (extended)
+ io = IOwait cpu sage in %
Color: Purple
us = User cpu usage in %
Color: Yellow, dark yellow if al>50%, orange if al>50%
@@ -615,9 +616,13 @@ Explanations:
Blue, purple if >30%
al = 100% minus id
pk = Max al peak of last avg. samples (extended)
- avg = System load average; desc. order: 1, 5 and 15 min. avg. (extended)
+ avg = System load average; desc. order: 1, 5 and 15 min. avg.
1px horizontal line: Maximum sy+us+io of last 'avg' samples (extended)
-(extended) means: text display only if extended mode is turned on
+ Extended means: text display only if extended mode is turned on
+Examples:
+ loadbars --extended 1 --hosts localhost
+ loadbars --hosts localhost,,server1.example.com,server2.example.com
+ loadbars --cluster foocluster (foocluster is in /etc/clusters of cssh)
END
# mode 1: Option is shown in the online help menu (stdout not sdl)
@@ -785,12 +790,11 @@ sub main () {
my ($hosts, $dispatch) = dispatch_table;
my $usage;
- use Data::Dumper;
GetOptions ('help|?' => \$usage, $dispatch->('options'));
if (defined $usage) {
say $dispatch->('usage');
- exit 0;
+ exit 1;
}
set_togglecpu_regexp;
@@ -805,10 +809,10 @@ sub main () {
system 'ssh-add';
} else {
- @hosts = 'localhost';
+ say $dispatch->('usage');
+ exit 1;
}
-
my @threads = create_threads @hosts;
main_loop $dispatch, @threads;
}