From 6544ba03a0cb6794354b4283bf9c04e0dffb4dfa Mon Sep 17 00:00:00 2001 From: Patrick Stadler Date: Sun, 29 Mar 2015 01:04:15 +0100 Subject: [PATCH] disk_io now checks if `iostat` is available. "done" is now always printed before exiting --- lib/main.sh | 3 ++- metrics/disk_io.sh | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/main.sh b/lib/main.sh index 7b5684b..11987f9 100644 --- a/lib/main.sh +++ b/lib/main.sh @@ -178,7 +178,8 @@ main_terminate () { if [ -d $TEMP_DIR ]; then rmdir $TEMP_DIR fi - verbose "done" + + echo "done" } main_print_docs () { diff --git a/metrics/disk_io.sh b/metrics/disk_io.sh index cc5407e..3f4baf8 100644 --- a/metrics/disk_io.sh +++ b/metrics/disk_io.sh @@ -11,6 +11,11 @@ defaults () { } start () { + if ! command_exists iostat; then + echo "Warning: disk_io requires the command 'iostat' to be available" + return 1 + fi + readonly fifo=$TEMP_DIR/$(unique_id)_disk_io mkfifo $fifo