Skip to content

Commit

Permalink
Changed the output of failed and unknow result, to not include the me…
Browse files Browse the repository at this point in the history
…tric
  • Loading branch information
Yornik Heyl committed Jan 12, 2018
1 parent cd7d4d4 commit a28a9f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ check_rabbitmq-sync.rb 1.0
check_zmstatus.pl 1.0
check_ssl-cert 1.0
check_topology-latency.rb 1.0
check_graphite-metric 1.0
check_graphite-metric 1.1
check_oom-killer.rb 0.1.2
check_bgp 1.1

Expand Down
4 changes: 2 additions & 2 deletions check_graphite-metric
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ CURL_URI="${GRAPHITE_QUERY_BASE}${METRIC_STRING}"
for GRAPHITE_OUT in $(curl ${CURL_OPTIONS} ${CURL_URI} | sed 's/ //g') ; do
if [[ "${GRAPHITE_OUT:0:1}" =~ ^\<.*|^\{.* ]] ; then
GLOBAL_STATE=3
CHECK_OUTPUT="Graphite returned an error, check your metric: ${METRIC_STRING}"
CHECK_OUTPUT="Graphite returned an error, check your metric"
exit_unk
fi
GRAPHITE_METRIC=$(cut -f1 -d\| <<< $GRAPHITE_OUT | sed 's/,[0-9]*,[0-9]*,[0-9]*$//')
Expand All @@ -245,7 +245,7 @@ done
PREV_STATUS=${NAGIOS_LASTSERVICESTATEID:-0}
if [ ${#RES_VALUES[@]} -eq 0 ] ; then
EXIT_NAGIOS_STATUS=$DEFAULT_NULL_STATUS
if [ ${DEFAULT_NULL_STATUS} -eq 3 ] ; then CHECK_OUTPUT="Graphite query ${METRIC_STRING} returned nothing." ; fi
if [ ${DEFAULT_NULL_STATUS} -eq 3 ] ; then CHECK_OUTPUT="Graphite query returned nothing." ; fi
else
for METRIC in ${RES_METRICS[*]} ; do
METRIC_STATUS=0
Expand Down

0 comments on commit a28a9f1

Please sign in to comment.