"MaJ expl_check_all_nrpe.sh"

This commit is contained in:
Doug Le Tough 2017-07-23 07:24:45 +02:00
parent de5459499d
commit 9053325637

View File

@ -125,16 +125,17 @@ function check_all
{
for CHECK in $(find ${NRPE_CHECK_PATH} -type f -executable -exec basename {} .cfg \; | sort )
do
fct_message "Contrôle ${CHECK}:" -color jaune
for HOST in ${TETALAB_VM[@]}
do
CRITICAL=1
if [ "${HOST}" == "${INFRA_SERVER}" ]; then
fct_message "Contrôle ${CHECK} sur ${HOST}" -color jaune
fct_message " * ${HOST}"
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
fct_message " * ${HOST}"
RESULT=$(${NRPE_CHECK_BIN} -H ${HOST} -c ${CHECK} | cut -d'|' -f1)
CRITICAL=$(echo ${RESULT} | grep OK | wc -l)
fi