From 7f2ae83eb6b1c9f457b9c652101a01542b66693e Mon Sep 17 00:00:00 2001 From: Tomaz Solc Date: Mon, 3 Oct 2016 18:29:40 +0200 Subject: [PATCH] systemd: don't print out empty extinfo lines This fixes warnings like this in munin-update.log: [WARNING] 4 lines had errors while 8 lines were correct (33. 33%) in data from 'fetch systemd' --- plugins/system/systemd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/system/systemd b/plugins/system/systemd index 810c3b07..1f06fa8d 100755 --- a/plugins/system/systemd +++ b/plugins/system/systemd @@ -79,8 +79,10 @@ fetch () { $states ; do echo -n "$state.value " grep $state$ $tmp | wc -l - echo -n "$state.extinfo " - echo $(grep $state$ $tmp | cut -d " " -f 1) + extinfo=`grep $state$ $tmp | cut -d " " -f 1` + if [ "$extinfo" ]; then + echo "$state.extinfo" $extinfo + fi done rm $tmp ;;