"MaJ expl_check_all_nrpe.sh"

This commit is contained in:
Doug Le Tough 2017-07-23 07:21:23 +02:00
parent 7f4cf9af4b
commit 8dc4d4eb70
2 changed files with 10 additions and 5 deletions

View File

@ -129,10 +129,12 @@ function check_all
do do
CRITICAL=1 CRITICAL=1
if [ "${HOST}" == "${INFRA_SERVER}" ]; then if [ "${HOST}" == "${INFRA_SERVER}" ]; then
fct_message "Contrôle ${CHECK} sur ${HOST}" -color jaune
RESULT=$(${NRPE_CHECK_BIN} -H ${HOST} -c ${CHECK} | cut -d'|' -f1) RESULT=$(${NRPE_CHECK_BIN} -H ${HOST} -c ${CHECK} | cut -d'|' -f1)
CRITICAL=$(echo ${RESULT} | grep OK | wc -l) CRITICAL=$(echo ${RESULT} | grep OK | wc -l)
elif [ $(echo ${CHECK} | grep "check_http_" | wc -l) -eq 0 ]; then elif [ $(echo ${CHECK} | grep "check_http_" | wc -l) -eq 0 ]; then
# On ne fait pas les checks HTTP sur les autres VM que le serveur d'infra (sousetsuken) # On ne fait pas les checks HTTP sur les autres VM que le serveur d'infra (sousetsuken)
fct_message "Contrôle ${CHECK} sur ${HOST}" -color jaune
RESULT=$(${NRPE_CHECK_BIN} -H ${HOST} -c ${CHECK} | cut -d'|' -f1) RESULT=$(${NRPE_CHECK_BIN} -H ${HOST} -c ${CHECK} | cut -d'|' -f1)
CRITICAL=$(echo ${RESULT} | grep OK | wc -l) CRITICAL=$(echo ${RESULT} | grep OK | wc -l)
fi fi
@ -145,9 +147,12 @@ function check_all
function send_message function send_message
{ {
if [ ${#MESSAGE} -gt 0 ]; then if [ ${#MESSAGE} -eq 0 ]; then
${IRC_BOT} "${MESSAGE}" fct_message "Aucun message à envoyer" -color jaune
fct_erreur 0
fi fi
fct_message "Envoi du message ${MESSAGE}" -color jaune
${IRC_BOT} "${MESSAGE}"
} }
#------------------------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------------------------

View File

@ -5,6 +5,6 @@ INFRA_SERVER=sousetsuken.local.tetalab.org
TETALAB_VM[0]=sousetsuken.local.tetalab.org TETALAB_VM[0]=sousetsuken.local.tetalab.org
TETALAB_VM[1]=jimmy.local.tetalab.org TETALAB_VM[1]=jimmy.local.tetalab.org
TETALAB_VM[2]=billy.local.tetalab.org TETALAB_VM[2]=billy.local.tetalab.org
TETALAB_VM[3]=marian.local.tetalab.org TETALAB_VM[3]=sonny.local.tetalab.org
TETALAB_VM[4]=sonny.local.tetalab.org TETALAB_VM[4]=web.local.tetalab.org
TETALAB_VM[5]=web.local.tetalab.org # ATTENTION: Marian n'est *volontairement* pas monitorée