diff --git a/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 b/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 index e0d36292fd2b613bd5b0a461229e8c51cfa11396..ad5e7d4e5a7ad1d8d16374edff3ca0ece0b62125 100644 --- a/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 +++ b/templates/usr/local/bin/nfs_timeout_notification.service.sh.j2 @@ -6,7 +6,7 @@ journalctl -f | while read -r LINE; do TIMEOUT=$(echo "${LINE}" | grep "nfs.*timed out"); if [[ ! -z "${TIMEOUT}" ]]; then TIME=$(date +%s); - if [[ "${TIME}" -ge "${NO_MAIL_UNTIL}" ]]; then + if [[ "${TIME}" -ge "${NO_MAIL_UNTIL_EPOCH}" ]]; then NO_MAIL_UNTIL_EPOCH=$((TIME + WAIT_BETWEEN_MAILS_IN_SECONDS)); echo "NFS timeout detected, sending mail to staff"; echo "${TIMEOUT}" | /usr/bin/mail -s "NFS timeout detected on $(hostname -f)" {{ vault_nfs_timeout_notification_service.staff_mail }};