Browse Source

"MaJ expl_check_all_nrpe.sh"

master
Doug Le Tough 4 years ago
parent
commit
8dc4d4eb70
2 changed files with 10 additions and 5 deletions
  1. +7
    -2
      bin/expl_check_all_nrpe.sh
  2. +3
    -3
      conf/expl_check_all_nrpe.conf

+ 7
- 2
bin/expl_check_all_nrpe.sh View File

@ -129,10 +129,12 @@ function check_all
do
CRITICAL=1
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)
CRITICAL=$(echo ${RESULT} | grep OK | wc -l)
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)
fct_message "Contrôle ${CHECK} sur ${HOST}" -color jaune
RESULT=$(${NRPE_CHECK_BIN} -H ${HOST} -c ${CHECK} | cut -d'|' -f1)
CRITICAL=$(echo ${RESULT} | grep OK | wc -l)
fi
@ -145,9 +147,12 @@ function check_all
function send_message
{
if [ ${#MESSAGE} -gt 0 ]; then
${IRC_BOT} "${MESSAGE}"
if [ ${#MESSAGE} -eq 0 ]; then
fct_message "Aucun message à envoyer" -color jaune
fct_erreur 0
fi
fct_message "Envoi du message ${MESSAGE}" -color jaune
${IRC_BOT} "${MESSAGE}"
}
#------------------------------------------------------------------------------------------------------------------


+ 3
- 3
conf/expl_check_all_nrpe.conf View File

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

Loading…
Cancel
Save