Enhance output of "nagcollecttest" script
authorAlexander Barton <alex@barton.de>
Fri, 10 Aug 2012 08:52:19 +0000 (10:52 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 10 Aug 2012 08:52:19 +0000 (10:52 +0200)
Now it displays "NO result" when the test script didn't produce any
output and the nagcollect client wouldn't send anything to the server.

client/bin/nagcollecttest

index e31644f..4bcba08 100755 (executable)
@@ -34,6 +34,9 @@ fi
 SERVICE=""; STATUS=""; TEXT=""
 echo "Checking \"$tst\" ..."
 . "$tst"
-echo "RESULT: $SERVICE=$STATUS \"$TEXT\""
+
+[ -n "$STATUS" -o -n "$TEXT" ] \
+       && echo "RESULT: $SERVICE=$STATUS \"$TEXT\"" \
+       || echo "NO result ..."
 
 # -eof-