diff options
| author | Paul Buetow <paul@buetow.org> | 2010-11-06 17:16:45 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2010-11-06 17:16:45 +0000 |
| commit | 782e5607cc631cf4f703a6c0b96edfd359139639 (patch) | |
| tree | d72283279bca6901fcd2dae9315af44c9e90daa9 | |
| parent | 50cb80b6d49216f68c1e3380e2f6178f1a0fe8dc (diff) | |
it works
| -rwxr-xr-x | cpupload.pl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpupload.pl b/cpupload.pl index 34112d1..5538e04 100755 --- a/cpupload.pl +++ b/cpupload.pl @@ -119,6 +119,7 @@ sub graph_stats ($$) { loop { my ($x, $y) = (0, 0); + for my $key (sort keys %GLOBAL_STATS) { my ($host, $name) = split ';', $key; my %stat = map { my ($k, $v) = split '='; $k => $v } split ';', $GLOBAL_STATS{$key}; @@ -177,9 +178,10 @@ sub graph_stats ($$) { $x += $width + 1; - usleep $GLOBAL_CONF{sleep} * 100000; }; + usleep $GLOBAL_CONF{sleep} * 1000000; + }; return undef; @@ -212,11 +214,11 @@ sub display_stats () { } sub main (@_) { - my $host = shift; - $host = 'localhost' unless defined $host; + my @hosts = @_; + @hosts = 'localhost' unless @hosts; my @threads; - push @threads, threads->create('get_remote_stat', $host); + push @threads, threads->create('get_remote_stat', $_) for @hosts; push @threads, threads->create('display_stats'); while (<STDIN>) { |
