PLUGIN_* files are recreated at each run

Only MACO_VERSION_RESULT needs to be kept for ~10 hours (to avoid to
mount store.ipr everytime!).
This commit is contained in:
Jeremy Gardais 2021-01-14 12:07:16 +01:00
parent f92520577f
commit 20e4713e56
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 17 additions and 20 deletions

View File

@ -277,8 +277,6 @@ $(cat ${PLUGIN_RESULT})"
main() { # {{{ main() { # {{{
# Create or empty previous file only if too old # 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}" regenerate_if_too_old "${MACO_VERSION_RESULT}"
## If MACO_VERSION_RESULT file is empty ## If MACO_VERSION_RESULT file is empty
@ -287,29 +285,28 @@ main() { # {{{
check_maco_version check_maco_version
fi fi
## If any previous file is empty ## Add HTML header for this part
if is_file_empty "${PLUGIN_RESULT}" || is_file_empty "${PLUGIN_STATE}"; then add_header "Compare version" >> "${PLUGIN_RESULT}"
## Add HTML header for this part ## Analyze Maco update result (add color,…)
add_header "Compare version" >> "${PLUGIN_RESULT}" analyze_maco_update
## Analyze Maco update result (add color,…)
analyze_maco_update
## Add HTML header for this part ## Add HTML header for this part
add_header "Pending update" >> "${PLUGIN_RESULT}" add_header "Pending update" >> "${PLUGIN_RESULT}"
## Check for pending update for Maco ## Check for pending update for Maco
check_pending_update check_pending_update
## Check for urgent pending update for Maco ## Check for urgent pending update for Maco
check_pending_urgent_update check_pending_urgent_update
## Add HTML header for this part ## Add HTML header for this part
add_header "Last update" >> "${PLUGIN_RESULT}" add_header "Last update" >> "${PLUGIN_RESULT}"
## Check status of last update ## Check status of last update
check_last_update_status check_last_update_status
fi
# Send data to Xymon server # Send data to Xymon server then
## delete useless files
## and exit ## and exit
send_result_to_xymon_server \ send_result_to_xymon_server \
&& rm -f -- "${PLUGIN_RESULT}" "${PLUGIN_STATE}" \
&& exit 0 && exit 0
} }