Add title with add_header func

This commit is contained in:
Jeremy Gardais 2021-01-13 13:02:32 +01:00
parent 176835f599
commit 88c0b2766f
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 21 additions and 5 deletions

View File

@ -115,6 +115,23 @@ ${_file_empty} file is not empty."
}
# }}}
# Add HTML header {{{
add_header()
{
echo ""
#echo "<FONT SIZE=+2><b>$1</b></FONT> ($2)<BR>"
echo "<FONT SIZE=+2><b>$1</b></FONT> <BR>"
# If you do not want the header in a bigger font use line below instead
#echo "<b>$1</b> ($2)"
# If you want the "Paul Luzzi" look uncomment this section and comment
# out the above sections:
#echo "<P><DIV ALIGN=\"CENTER\"><HR>"
#echo "<B>============== $1 ==============</B>"
#echo "<B>--- ($2) ---</B>"
#echo "<HR></DIV>"
#echo "<BLOCKQUOTE>"
}
# }}}
# Get Maco update state {{{
get_maco_update() {
@ -205,15 +222,11 @@ send_result_to_xymon_server() {
# Send informations to Xymon server
$XYMON "${XYMSRV}" "status ${MACHINE}.${TEST} ${COLOR} ${SUBJECT}
==================== Detailed status ====================
$(cat ${PLUGIN_RESULT})"
# For testing only
#echo "$XYMON ${XYMSRV} status ${MACHINE}.${TEST} ${COLOR} ${SUBJECT}
#==================== Detailed status ====================
#$(cat ${PLUGIN_RESULT})" > /tmp/xymon.maco.tmp
}
@ -227,14 +240,17 @@ main() { # {{{
## 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"
## (re)check Maco update
get_maco_update
## Analyze Maco update result (add color,…)
analyze_maco_update
## Add HTML header for this part
add_header "Pending update"
## Check for pending update for Maco
check_pending_update
## Check for urgent pending update for Maco
check_pending_urgent_update
fi