From 7b33a5947d0726434b04af619542a6d3b951e6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 13 Jan 2021 16:08:31 +0100 Subject: [PATCH] Red color is reserved for failed update --- xymon/plugins/client/ext/maco.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xymon/plugins/client/ext/maco.sh b/xymon/plugins/client/ext/maco.sh index f682a40..d94ae13 100755 --- a/xymon/plugins/client/ext/maco.sh +++ b/xymon/plugins/client/ext/maco.sh @@ -1,6 +1,10 @@ #!/bin/sh -# This script will check if upgrade is available for local Maco script +# This script will check: +## if upgrade is available for local Maco script (green or yellow) +## if normal upgrade is planned (green or yellow) +## if urgent upgrade is planned (green or yellow) +## status of the last update (green, yellow or red) # Vars {{{ readonly PROGNAME=$(basename "${0}") @@ -164,8 +168,8 @@ Try to detect Maco update with ${TEMP_MACO_UPDATE} content." echo "26${YELLOW_PIC} Maco needs upgrade" >> "${PLUGIN_STATE}" elif grep -qE '^Urgent.* available.*' "${TEMP_MACO_UPDATE}" then - sed "s/^/\&${RED_PIC} /" "${TEMP_MACO_UPDATE}" >> "${PLUGIN_RESULT}" - echo "16${RED_PIC} Maco needs urgent upgrade" >> "${PLUGIN_STATE}" + sed "s/^/\&${YELLOW_PIC} /" "${TEMP_MACO_UPDATE}" >> "${PLUGIN_RESULT}" + echo "25${YELLOW_PIC} Maco needs urgent upgrade" >> "${PLUGIN_STATE}" else sed "s/^/\&${CLEAR_PIC} /" "${TEMP_MACO_UPDATE}" >> "${PLUGIN_RESULT}" echo "46${CLEAR_PIC} Maco update state is unknown" >> "${PLUGIN_STATE}" @@ -200,9 +204,9 @@ check_pending_urgent_update() { debug_message "check_pending_urgent_update − \ An urgent Maco update is planned." ## Add color and message to PLUGIN_RESULT for detailed informations - echo "${RED_PIC} An urgent update is planned (${MACO_PENDING_URGENT_UPDATE_FILE} file exists)." >> "${PLUGIN_RESULT}" + echo "${YELLOW_PIC} An urgent update is planned (${MACO_PENDING_URGENT_UPDATE_FILE} file exists)." >> "${PLUGIN_RESULT}" ## Add information to PLUGIN_STATE - echo "14${RED_PIC} An urgent update is planned" >> "${PLUGIN_STATE}" + echo "23${YELLOW_PIC} An urgent update is planned" >> "${PLUGIN_STATE}" else debug_message "check_pending_urgent_update − \ No Maco urgent update is planned."