From 4d11822bc606f046aa8a50c5dfcacfb73907fbfa Mon Sep 17 00:00:00 2001 From: Filippo Squillace Date: Wed, 4 Sep 2019 19:16:48 +1000 Subject: [PATCH] Fix bug when checking whether `vmstat` exists --- scripts/cpu_collect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cpu_collect.sh b/scripts/cpu_collect.sh index 768caba..a37148f 100755 --- a/scripts/cpu_collect.sh +++ b/scripts/cpu_collect.sh @@ -22,7 +22,7 @@ get_cpu_usage() { | sed -u -nr '/CPU usage/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)%[[:space:]]*idle.*/\1/p' \ | stdbuf -o0 awk '{ print 100-$0 }' fi - elif ! command_exists "vmstat"; then + elif command_exists "vmstat"; then if is_freebsd; then vmstat -n "$refresh_interval" -c "$samples_count" \ | stdbuf -o0 awk 'NR>2 {print 100-$(NF-0)}'