From bb45317437337c526531c21cf63fbe750e93dc10 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 25 Jul 2018 15:57:09 +0200 Subject: usr-lib-nagios-plugins/check_puppetmaster.sh: Silence grep output. --- usr-lib-nagios-plugins/check_puppetmaster.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr-lib-nagios-plugins/check_puppetmaster.sh b/usr-lib-nagios-plugins/check_puppetmaster.sh index 67bd249..0708a34 100755 --- a/usr-lib-nagios-plugins/check_puppetmaster.sh +++ b/usr-lib-nagios-plugins/check_puppetmaster.sh @@ -115,7 +115,7 @@ PERF_TIME=$( perl -e "printf('%1.3f', $T2 - $T1);" ) if [ "$CURL_RESULT" != 0 ]; then EXIT=2 MESSAGE="${URL} $CURL_NODE" -elif echo $CURL_NODE | grep '"environment":'; then +elif echo $CURL_NODE | grep -q '"environment":'; then FOUND=$( echo "$CURL_NODE" | sed -r -e 's/.*"environment":"([^"]+)".*/\1/' ) EXIT=0 MESSAGE="found '${FOUND}' in https://${PUPPETMASTER}:${PORT}/puppet/v3/node/${HOST}?environment=production" -- cgit v1.2.3