summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2012-06-23 18:02:11 +0200
committerPaul Buetow <paul@buetow.org>2012-06-23 18:02:11 +0200
commit566d91946cdfa356342c63975ff572d143b68fc2 (patch)
tree9f8e8a0b9ba74efcfa2f5e845f3e471f8761e954
parent59099ea8ad16763eb272d9656d12e6d846373114 (diff)
fix on netstats
-rw-r--r--lib/Loadbars/Main.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm
index 126f6f8..95938fe 100644
--- a/lib/Loadbars/Main.pm
+++ b/lib/Loadbars/Main.pm
@@ -132,9 +132,9 @@ sub stats_thread ($;$) {
open FH, qq(/proc/net/dev);
<FH>; <FH>;
while (<FH>) {
- s/://;
+ next unless s/:/ /;
my (\\\$foo, \\\$int, \\\$bytes, \\\$packets, \\\$errs, \\\$drop, \\\$fifo, \\\$frame, \\\$compressed, \\\$multicast, \\\$tbytes, \\\$tpackets, \\\$terrs, \\\$tdrop, \\\$tfifo, \\\$tcolls, \\\$tcarrier, \\\$tcompressed) = split \\\$whitespace_re, \\\$_;
- printf qq(%s;int=%s;b=%d;tb=%d;p=%d;tp=%d\n),
+ printf qq(%s:b=%d;tb=%d;p=%d;tp=%d\n),
\\\$int, \\\$bytes,
\\\$tbytes, \\\$packets, \\\$tpackets;
}
@@ -221,8 +221,9 @@ REMOTECODE
}
}
elsif ( $mode == 3 ) {
- #$NETSTATS{$host} = $_;
- #$NETSTATS_HAS{$host} = 1 unless defined $NETSTATS_HAS{$host};
+ $NETSTATS{$host} = $_;
+ print "$_\n";
+ $NETSTATS_HAS{$host} = 1 unless defined $NETSTATS_HAS{$host};
}
if ($sigusr1) {