From 1b2148ecebb81e095a93c22d9c872134df43834f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 10 Jun 2020 16:15:29 +0200 Subject: [PATCH] Display more informations after queue state --- xymon/plugins/client/ext/sge.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/xymon/plugins/client/ext/sge.sh b/xymon/plugins/client/ext/sge.sh index 4cebcae..6c83b23 100755 --- a/xymon/plugins/client/ext/sge.sh +++ b/xymon/plugins/client/ext/sge.sh @@ -176,42 +176,38 @@ get_status() # Order determines more significant alert status if [ "$(echo "${qstate}" | grep -c d)" != "0" ]; then echo "4&clear $queue@$HOST is DISABLED" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$CLEAR_PIC $queue@$HOST is DISABLED") + queueMsg=$(echo "$queueMsg
$CLEAR_PIC $queue@$HOST is DISABLED
${_LINE}") queueTriggered=true; elif [ "$(echo "${qstate}" | grep -c E)" != "0" ]; then echo "1&red $queue@$HOST is in ERROR!" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$RED_PIC $queue@$HOST is in ERROR") + queueMsg=$(echo "$queueMsg
$RED_PIC $queue@$HOST is in ERROR!
${_LINE}") queueTriggered=true; elif [ "$(echo "${qstate}" | grep -c c)" != "0" ]; then echo "2&yellow $queue@$HOST has an ambigious configuration!" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST has an ambigious configuration!") + queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST has an ambigious configuration!
${_LINE}") queueTriggered=true; elif [ "$(echo "${qstate}" | grep -c a)" != "0" ] || \ [ "$(echo "${qstate}" | grep -c A)" != "0" ]; then echo "2&yellow $queue@$HOST is in ALARM" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST is in ALARM") + queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST is in ALARM
${_LINE}") elif [ "$(echo "${qstate}" | grep -c s)" != "0" ] || \ [ "$(echo "${qstate}" | grep -c S)" != "0" ]; then echo "2&yellow $queue@$HOST is SUSPENDED" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST is SUSPENDED") + queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST is SUSPENDED
${_LINE}") elif [ "$(echo "${qstate}" | grep -c u)" != "0" ]; then echo "2&yellow $queue@$HOST is UNAVAILABLE" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST is UNAVAILABLE!") + queueMsg=$(echo "$queueMsg
$YELLOW_PIC $queue@$HOST is UNAVAILABLE!
${_LINE}") queueTriggered=true; elif [ "$qstate" = "" ]; then echo "3&green $queue@$HOST is OK" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$GREEN_PIC $queue@$HOST is OK") + queueMsg=$(echo "$queueMsg
$GREEN_PIC $queue@$HOST is OK
${_LINE}") else echo "5&purple $queue@$HOST is UNKNOWN" >> "${PLUGIN_STATE}" - queueMsg=$(echo "$queueMsg
$UNKNOWN_PIC $queue@$HOST is UNKNOWN") + queueMsg=$(echo "$queueMsg
$UNKNOWN_PIC $queue@$HOST is UNKNOWN
${_LINE}") queueTriggered=true; fi done < "${PLUGIN_RESULT}.QSTATE" - if [ -f "${PLUGIN_RESULT}.QSTATE" ]; then - rm -f -- "${PLUGIN_RESULT}.QSTATE" - fi - get_header "Queue Instance Status Report" echo "$queueMsg" get_footer @@ -239,7 +235,7 @@ COLOR=$(< "${PLUGIN_STATE}" awk '{print $1}' | sort | uniq | head -1 | cut -c3-) # and may not actually run on every client # if [ -f "${PLUGIN_RESULT}" ]; then - rm -f -- "${PLUGIN_RESULT}" "${PLUGIN_STATE}" + rm -f -- "${PLUGIN_RESULT}" "${PLUGIN_STATE}" "${PLUGIN_RESULT}.QSTATE" fi ############################################## # end of script