diff --git a/src/health/notifications/alarm-notify.sh.in b/src/health/notifications/alarm-notify.sh.in index c7c44cb116a287..d7baa7345022ea 100755 --- a/src/health/notifications/alarm-notify.sh.in +++ b/src/health/notifications/alarm-notify.sh.in @@ -769,6 +769,9 @@ fi # check custom [ -z "${DEFAULT_RECIPIENT_CUSTOM}" ] && SEND_CUSTOM="NO" +# check ilert +[ -z "${ILERT_ALERT_SOURCE_URL}" ] && SEND_ILERT="NO" + # ----------------------------------------------------------------------------- # check the availability of targets @@ -798,7 +801,8 @@ check_supported_targets() { [ "${SEND_DYNATRACE}" = "YES" ] || [ "${SEND_OPSGENIE}" = "YES" ] || [ "${SEND_GOTIFY}" = "YES" ] || - [ "${SEND_NTFY}" = "YES" ]; then + [ "${SEND_NTFY}" = "YES" ] || + [ "${SEND_ILERT}" = "YES" ]; then # if we need curl, check for the curl command if [ -z "${curl}" ]; then curl="$(command -v curl 2>/dev/null)" @@ -828,6 +832,7 @@ check_supported_targets() { SEND_OPSGENIE="NO" SEND_GOTIFY="NO" SEND_NTFY="NO" + SEND_ILERT="NO" fi fi @@ -983,7 +988,8 @@ for method in "${SEND_EMAIL}" \ "${SEND_DYNATRACE}" \ "${SEND_OPSGENIE}" \ "${SEND_GOTIFY}" \ - "${SEND_NTFY}" ; do + "${SEND_NTFY}" \ + "${SEND_ILERT}" ; do if [ "${method}" == "YES" ]; then proceed=1 @@ -2431,6 +2437,50 @@ send_ntfy() { return 1 } +# ----------------------------------------------------------------------------- +# ilert sender + +send_ilert() { + local payload httpcode + [ "${SEND_ILERT}" != "YES" ] && return 1 + + if [ -z "${ILERT_ALERT_SOURCE_URL}" ] ; then + info "Can't send ilert notification, because ILERT_ALERT_SOURCE_URL is not defined" + return 1 + fi + + payload=$(cat <