summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (mars) <paul@buetow.org>2011-11-27 14:46:45 +0100
committerPaul Buetow (mars) <paul@buetow.org>2011-11-27 14:46:45 +0100
commit33aaa41692cf48d157f34e7252dada5e81ae5b7d (patch)
tree87cb72d1a908b1fc9124d93237d12f0b1bbb1c79
parentc58de796e101aef188a810ff0eab5b33bf6d889a (diff)
Initial meminfo for Linux
-rwxr-xr-xloadbars.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/loadbars.pl b/loadbars.pl
index 9136911..7b46c24 100755
--- a/loadbars.pl
+++ b/loadbars.pl
@@ -26,7 +26,7 @@ use threads::shared;
use constant {
DEPTH => 8,
- VERSION => 'loadbars v0.2.2',
+ VERSION => 'loadbars v0.2.2-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),
@@ -51,6 +51,7 @@ $| = 1;
my %AVGSTATS : shared;
my %CPUSTATS : shared;
+my %MEMSTATS : shared;
# Global configuration hash
my %C : shared;
@@ -99,9 +100,10 @@ sub thread_get_stats ($) {
if [ -e /proc/stat ]; then
loadavg=/proc/loadavg
stat=/proc/stat
+ meminfo=/proc/meminfo
for i in \$(seq $C{samples}); do
- cat \$loadavg \$stat
+ cat \$loadavg \$stat \$meminfo
sleep $C{inter}
done
else
@@ -127,8 +129,6 @@ BASH
$SIG{USR1} = sub { $sigusr1 = 1 };
my $cpuregexp = qr/$C{cpuregexp}/;
- # $SIG{STOP} = sub { debugsay kill 9, $pid; $quit = 1 };
-
while (<$pipe>) {
if (/^$loadavgexp/) {
$AVGSTATS{$host} = "$1;$2;$3";