From 20e4713e5636ebd93b2775f80d6c95253ca07906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Thu, 14 Jan 2021 12:07:16 +0100 Subject: [PATCH] PLUGIN_* files are recreated at each run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only MACO_VERSION_RESULT needs to be kept for ~10 hours (to avoid to mount store.ipr everytime!). --- xymon/plugins/client/ext/maco.sh | 37 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/xymon/plugins/client/ext/maco.sh b/xymon/plugins/client/ext/maco.sh index d662022..dd5d5eb 100755 --- a/xymon/plugins/client/ext/maco.sh +++ b/xymon/plugins/client/ext/maco.sh @@ -277,8 +277,6 @@ $(cat ${PLUGIN_RESULT})" main() { # {{{ # Create or empty previous file only if too old - regenerate_if_too_old "${PLUGIN_RESULT}" - regenerate_if_too_old "${PLUGIN_STATE}" regenerate_if_too_old "${MACO_VERSION_RESULT}" ## If MACO_VERSION_RESULT file is empty @@ -287,29 +285,28 @@ main() { # {{{ check_maco_version fi - ## If any previous file is empty - if is_file_empty "${PLUGIN_RESULT}" || is_file_empty "${PLUGIN_STATE}"; then - ## Add HTML header for this part - add_header "Compare version" >> "${PLUGIN_RESULT}" - ## Analyze Maco update result (add color,…) - analyze_maco_update + ## Add HTML header for this part + add_header "Compare version" >> "${PLUGIN_RESULT}" + ## Analyze Maco update result (add color,…) + analyze_maco_update - ## Add HTML header for this part - add_header "Pending update" >> "${PLUGIN_RESULT}" - ## Check for pending update for Maco - check_pending_update - ## Check for urgent pending update for Maco - check_pending_urgent_update + ## Add HTML header for this part + add_header "Pending update" >> "${PLUGIN_RESULT}" + ## Check for pending update for Maco + check_pending_update + ## Check for urgent pending update for Maco + check_pending_urgent_update - ## Add HTML header for this part - add_header "Last update" >> "${PLUGIN_RESULT}" - ## Check status of last update - check_last_update_status - fi + ## Add HTML header for this part + add_header "Last update" >> "${PLUGIN_RESULT}" + ## Check status of last update + check_last_update_status - # Send data to Xymon server + # Send data to Xymon server then + ## delete useless files ## and exit send_result_to_xymon_server \ + && rm -f -- "${PLUGIN_RESULT}" "${PLUGIN_STATE}" \ && exit 0 }