#!/bin/bash # logger toutes les variables dans un fichier log avec un timecode touch executor.log echo "$(date)" >> executor.log echo $AMX_RECEIVER >> executor.log echo $AMX_STATUS >> executor.log echo $AMX_EXTERNAL_URL >> executor.log echo $AMX_LABEL_alertname >>executor.log echo "AMX_LABEL_instance "$AMX_LABEL_instance >> executor.log Instance=$(echo $AMX_LABEL_instance| cut -f1 -d":") echo "" BDD_HOSTNAME="10.192.43.11" if [[ "$AMX_LABEL_alertname" == "MysqlDown" ]]; then #écrire la commande à exécuter ici ssh root@$BDD_HOSTNAME 'systemctl restart mariadb* --all' else echo "Label is different, ${AMX_LABEL_alertname}" >> executor.log fi