summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-07 21:28:21 +0000
committerPaul Buetow <paul@buetow.org>2010-11-07 21:28:21 +0000
commit8692b0623333279982772ee527ceb0042426edf7 (patch)
treee20b8fda7c994a077f398c1c32322af8824712d0
parent5bd56761663b68d45299e1bbb831782092a756a4 (diff)
added linuprocfs support @ freebsd
-rwxr-xr-xcpuload.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpuload.pl b/cpuload.pl
index ca4c955..bc93a8d 100755
--- a/cpuload.pl
+++ b/cpuload.pl
@@ -65,7 +65,7 @@ sub parse_cpu_line ($) {
sub get_stat ($) {
my $host = shift;
- my $bash = "for i in \$(seq $CONF{samples}); do cat /proc/stat; sleep 0.1; done";
+ my $bash = "if [ -e /proc/stat ]; then proc=/proc/stat; else proc=/usr/compat/linux/proc/stat; fi; for i in \$(seq $CONF{samples}); do cat \$proc; sleep 0.1; done";
my $cmd = $host eq 'localhost' ? $bash : "ssh $CONF{sshopts} $host '$bash'";
my $sigusr1 = 0;