From 470ed0a8284cb16656cac0c0b5820c41a3283ca8 Mon Sep 17 00:00:00 2001 From: Patrick Stadler Date: Sun, 15 Mar 2015 10:48:01 +0100 Subject: [PATCH] fix metrics on Ubuntu --- metrics/disk_io.sh | 4 +++- metrics/memory.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/metrics/disk_io.sh b/metrics/disk_io.sh index ed14241..0486c3f 100644 --- a/metrics/disk_io.sh +++ b/metrics/disk_io.sh @@ -21,7 +21,9 @@ if is_osx; then } else __disk_io_bgproc () { - echo $(iostat -y -d 1 $DISK_IO_MOUNTPOINT) + iostat -y -m -d 1 $DISK_IO_MOUNTPOINT | while read line; do + echo $line | awk '/[0-9.]/{ print $3 }' > $__disk_io_fifo + done } fi diff --git a/metrics/memory.sh b/metrics/memory.sh index 6cf3bc0..17274b8 100644 --- a/metrics/memory.sh +++ b/metrics/memory.sh @@ -13,8 +13,8 @@ if is_osx; then } else collect () { - report $(free | awk '/buffers\/cache/ - { printf "%.1f", 100 - $4 / ($3 + $4) * 100.0 }') + report $(free | awk '/buffers\/cache/ { + printf "%.1f", 100 - $4 / ($3 + $4) * 100.0 }') } fi