diff --git a/plugins/system/systemd_units b/plugins/system/systemd_units index dd336dd7..0a55adc5 100755 --- a/plugins/system/systemd_units +++ b/plugins/system/systemd_units @@ -62,8 +62,8 @@ EOF fetch () { tmp=$(systemctl --no-pager --no-legend --all | awk '{print $1, $3}') for state in $states ; do - echo -n "$state.value " - echo "$tmp" | grep -c "$state$" + count=$(echo "$tmp" | grep -c "$state$") + echo "$state.value $count" extinfo=$(echo "$tmp" | grep "$state$" | cut -d " " -f 1) if [ -n "$extinfo" ]; then echo "$state.extinfo" $extinfo