summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--WISHLIST1
-rwxr-xr-xloadbars.pl25
2 files changed, 24 insertions, 2 deletions
diff --git a/WISHLIST b/WISHLIST
index 0ff20b6..1641641 100644
--- a/WISHLIST
+++ b/WISHLIST
@@ -1,3 +1,4 @@
* Stats for other stuff (e.g. memory, inodes..., disk usage)
* Dynamic/online resizing of the window
* Rudimentary support for /etc/clusters, the Cluster-SSH configuration file
+* Adding and removing hosts online
diff --git a/loadbars.pl b/loadbars.pl
index 3ea7c83..0413542 100755
--- a/loadbars.pl
+++ b/loadbars.pl
@@ -51,7 +51,7 @@ use IO::Socket;
use constant {
DEPTH => 8,
- VERSION => 'loadbars v0.2.0',
+ VERSION => 'loadbars v0.2.1-devel',
COPYRIGHT => '2010-2011 (c) Paul Buetow <loadbars@mx.buetow.org>',
BLACK => SDL::Color->new(-r => 0x00, -g => 0x00, -b => 0x00),
BLUE => SDL::Color->new(-r => 0x00, -g => 0x00, -b => 0xff),
@@ -68,7 +68,7 @@ use constant {
USER_ORANGE => 70,
USER_YELLOW0 => 50,
NULL => 0,
- DEBUG => 1,
+ DEBUG => 0,
};
$| = 1;
@@ -101,6 +101,27 @@ sub sum (@) { my $sum = 0; $sum += $_ for @_; return $sum }
sub null ($) { my $arg = shift; return defined $arg ? $arg : 0 }
sub set_togglecpu_regexp () { $CONF{cpuregexp} = $CONF{togglecpu} ? 'cpu ' : 'cpu' }
+sub unix_make_server_socket ($) {
+ my $socket_name = shift;
+ unlink $socket_name;
+
+ return IO::Socket::UNIX->new(
+ LocalAddr => $socket_name,
+ Type => SOCK_DGRAM,
+ Listen => 5
+ ) or die "$@\n";
+}
+
+sub unix_make_client_socket ($) {
+ my $socket_name = shift;
+
+ return IO::Socket::UNIX->new(
+ PeerAddr => $socket_name,
+ Type => SOCK_DGRAM,
+ Timeout => 10
+ ) or die "$@\n";
+}
+
sub parse_cpu_line ($) {
my ($name, %load);