4 # real-time performance and health monitoring, done right!
5 # (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
8 # Script to send alarm notifications for netdata
11 # - multiple notification methods
12 # - multiple roles per alarm
13 # - multiple recipients per role
14 # - severity filtering per recipient
16 # Supported notification methods:
18 # - pushover.net notifications
19 # - pushbullet.com push notifications
20 # - slack.com notifications
21 # - telegram.org notifications
24 export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
27 # -----------------------------------------------------------------------------
29 PROGRAM_NAME="$(basename "${0}")"
32 date "+%Y-%m-%d %H:%M:%S"
39 echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${*}"
62 [ $debug -eq 1 ] && log DEBUG "${@}"
65 # -----------------------------------------------------------------------------
67 # check for BASH v4+ (required for associative arrays)
68 [ $(( ${BASH_VERSINFO[0]} )) -lt 4 ] && \
69 fatal "BASH version 4 or later is required (this is ${BASH_VERSION})."
71 # -----------------------------------------------------------------------------
72 # defaults to allow running this script by hand
74 NETDATA_CONFIG_DIR="${NETDATA_CONFIG_DIR-/etc/netdata}"
75 NETDATA_CACHE_DIR="${NETDATA_CACHE_DIR-/var/cache/netdata}"
76 [ -z "${NETDATA_REGISTRY_URL}" ] && NETDATA_REGISTRY_URL="https://registry.my-netdata.io"
77 [ -z "${NETDATA_HOSTNAME}" ] && NETDATA_HOSTNAME="$(hostname)"
78 [ -z "${NETDATA_REGISTRY_HOSTNAME}" ] && NETDATA_REGISTRY_HOSTNAME="${NETDATA_HOSTNAME}"
80 # -----------------------------------------------------------------------------
81 # parse command line parameters
83 roles="${1}" # the roles that should be notified for this event
84 host="${2}" # the host generated this event
85 unique_id="${3}" # the unique id of this event
86 alarm_id="${4}" # the unique id of the alarm that generated this event
87 event_id="${5}" # the incremental id of the event, for this alarm id
88 when="${6}" # the timestamp this event occurred
89 name="${7}" # the name of the alarm, as given in netdata health.d entries
90 chart="${8}" # the name of the chart (type.id)
91 family="${9}" # the family of the chart
92 status="${10}" # the current status : REMOVED, UNITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
93 old_status="${11}" # the previous status: REMOVED, UNITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
94 value="${12}" # the current value of the alarm
95 old_value="${13}" # the previous value of the alarm
96 src="${14}" # the line number and file the alarm has been configured
97 duration="${15}" # the duration in seconds of the previous alarm state
98 non_clear_duration="${16}" # the total duration in seconds this is/was non-clear
99 units="${17}" # the units of the value
100 info="${18}" # a short description of the alarm
102 # -----------------------------------------------------------------------------
103 # screen statuses we don't need to send a notification
105 # don't do anything if this is not WARNING, CRITICAL or CLEAR
106 if [ "${status}" != "WARNING" -a "${status}" != "CRITICAL" -a "${status}" != "CLEAR" ]
108 info "not sending notification for ${status} on '${chart}.${name}'"
112 # don't do anything if this is CLEAR, but it was not WARNING or CRITICAL
113 if [ "${old_status}" != "WARNING" -a "${old_status}" != "CRITICAL" -a "${status}" = "CLEAR" ]
115 info "not sending notification for ${status} on '${chart}.${name}' (last status was ${old_status})"
119 # -----------------------------------------------------------------------------
122 # By default fetch images from the global public registry.
123 # This is required by default, since all notification methods need to download
124 # images via the Internet, and private registries might not be reachable.
125 # This can be overwritten at the configuration file.
126 images_base_url="https://registry.my-netdata.io"
129 # if empty they will be searched in the system path
133 # enable / disable features
138 SEND_PUSHBULLET="YES"
142 DEFAULT_RECIPIENT_SLACK=
143 declare -A role_recipients_slack=()
147 DEFAULT_RECIPIENT_PUSHOVER=
148 declare -A role_recipients_pushover=()
151 PUSHBULLET_ACCESS_TOKEN=
152 DEFAULT_RECIPIENT_PUSHBULLET=
153 declare -A role_recipients_pushbullet=()
157 DEFAULT_RECIPIENT_TELEGRAM=
158 declare -A role_recipients_telegram=()
161 DEFAULT_RECIPIENT_EMAIL="root"
162 declare -A role_recipients_email=()
164 # load the user configuration
165 # this will overwrite the variables above
166 if [ -f "${NETDATA_CONFIG_DIR}/health_alarm_notify.conf" ]
168 source "${NETDATA_CONFIG_DIR}/health_alarm_notify.conf"
171 # -----------------------------------------------------------------------------
172 # filter a recipient based on alarm event severity
174 filter_recipient_by_criticality() {
175 local method="${1}" x="${2}" r s
178 r="${x/|*/}" # the recipient
179 s="${x/*|/}" # the severity required for notifying this recipient
181 # no severity filtering for this person
182 [ "${r}" = "${s}" ] && return 0
184 # the severity is invalid
186 [ "${s}" != "CRITICAL" ] && return 0
188 # the new or the old status matches the severity
189 if [ "${s}" = "${status}" -o "${s}" = "${old_status}" ]
191 [ ! -d "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}" ] && \
192 mkdir -p "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}"
194 # we need to keep track of the notifications we sent
195 # so that the same user will receive the recovery
196 # even if old_status does not match the required severity
197 touch "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}/${alarm_id}"
201 # it is a cleared alarm we have sent notification for
202 if [ "${status}" != "WARNING" -a "${status}" != "CRITICAL" -a -f "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}/${alarm_id}" ]
204 rm "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}/${alarm_id}"
211 # -----------------------------------------------------------------------------
212 # find the recipients' addresses per method
214 declare -A arr_slack=()
215 declare -A arr_pushover=()
216 declare -A arr_pushbullet=()
217 declare -A arr_telegram=()
218 declare -A arr_email=()
220 # netdata may call us with multiple roles, and roles may have multiple but
221 # overlapping recipients - so, here we find the unique recipients.
222 for x in ${roles//,/ }
224 # the roles 'silent' and 'disabled' mean:
225 # don't send a notification for this role
226 [ "${x}" = "silent" -o "${x}" = "disabled" ] && continue
229 a="${role_recipients_email[${x}]}"
230 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_EMAIL}"
233 [ "${r}" != "disabled" ] && filter_recipient_by_criticality email "${r}" && arr_email[${r/|*/}]="1"
237 a="${role_recipients_pushover[${x}]}"
238 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_PUSHOVER}"
241 [ "${r}" != "disabled" ] && filter_recipient_by_criticality pushover "${r}" && arr_pushover[${r/|*/}]="1"
245 a="${role_recipients_pushbullet[${x}]}"
246 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_PUSHBULLET}"
249 [ "${r}" != "disabled" ] && filter_recipient_by_criticality pushbullet "${r}" && arr_pushbullet[${r/|*/}]="1"
253 a="${role_recipients_telegram[${x}]}"
254 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_TELEGRAM}"
257 [ "${r}" != "disabled" ] && filter_recipient_by_criticality telegram "${r}" && arr_telegram[${r/|*/}]="1"
261 a="${role_recipients_slack[${x}]}"
262 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_SLACK}"
265 [ "${r}" != "disabled" ] && filter_recipient_by_criticality slack "${r}" && arr_slack[${r/|*/}]="1"
269 # build the list of slack recipients (channels)
270 to_slack="${!arr_slack[*]}"
271 [ -z "${to_slack}" ] && SEND_SLACK="NO"
273 # build the list of pushover recipients (user tokens)
274 to_pushover="${!arr_pushover[*]}"
275 [ -z "${to_pushover}" ] && SEND_PUSHOVER="NO"
277 # build the list of pushbulet recipients (user tokens)
278 to_pushbullet="${!arr_pushbullet[*]}"
279 [ -z "${to_pushbullet}" ] && SEND_PUSHBULLET="NO"
281 # check array of telegram recipients (chat ids)
282 to_telegram="${!arr_telegram[*]}"
283 [ -z "${to_telegram}" ] && SEND_TELEGRAM="NO"
285 # build the list of email recipients (email addresses)
287 for x in "${!arr_email[@]}"
289 [ ! -z "${to_email}" ] && to_email="${to_email}, "
290 to_email="${to_email}${x}"
292 [ -z "${to_email}" ] && SEND_EMAIL="NO"
295 # -----------------------------------------------------------------------------
296 # verify the delivery methods supported
299 [ -z "${SLACK_WEBHOOK_URL}" ] && SEND_SLACK="NO"
302 [ -z "${PUSHOVER_APP_TOKEN}" ] && SEND_PUSHOVER="NO"
305 [ -z "${DEFAULT_RECIPIENT_PUSHBULLET}" ] && SEND_PUSHBULLET="NO"
308 [ -z "${TELEGRAM_BOT_TOKEN}" ] && SEND_TELEGRAM="NO"
310 if [ \( "${SEND_PUSHOVER}" = "YES" -o "${SEND_SLACK}" = "YES" -o "${SEND_TELEGRAM}" = "YES" -o "${SEND_PUSHBULLET}" = "YES" \) -a -z "${curl}" ]
312 curl="$(which curl 2>/dev/null || command -v curl 2>/dev/null)"
322 if [ "${SEND_EMAIL}" = "YES" -a -z "${sendmail}" ]
324 sendmail="$(which sendmail 2>/dev/null || command -v sendmail 2>/dev/null)"
325 [ -z "${sendmail}" ] && SEND_EMAIL="NO"
328 # check that we have at least a method enabled
329 if [ "${SEND_EMAIL}" != "YES" -a "${SEND_PUSHOVER}" != "YES" -a "${SEND_TELEGRAM}" != "YES" -a "${SEND_SLACK}" != "YES" -a "${SEND_PUSHBULLET}" != "YES" ]
331 fatal "All notification methods are disabled. Not sending a notification."
334 # -----------------------------------------------------------------------------
335 # get the system hostname
337 [ -z "${host}" ] && host="${NETDATA_HOSTNAME}"
338 [ -z "${host}" ] && host="${NETDATA_REGISTRY_HOSTNAME}"
339 [ -z "${host}" ] && host="$(hostname 2>/dev/null)"
341 # -----------------------------------------------------------------------------
342 # get the date the alarm happened
344 date="$(date --date=@${when} 2>/dev/null)"
345 [ -z "${date}" ] && date="$(date 2>/dev/null)"
347 # -----------------------------------------------------------------------------
348 # URL encode a string
351 local string="${1}" strlen encoded pos c o
354 for (( pos=0 ; pos<strlen ; pos++ ))
363 printf -v o '%%%02x' "'$c"
373 # -----------------------------------------------------------------------------
374 # convert a duration in seconds, to a human readable duration
375 # using DAYS, MINUTES, SECONDS
378 local s="${1}" d=0 h=0 m=0 ds="day" hs="hour" ms="minute" ss="second" ret
380 s=$(( s - (d * 86400) ))
382 s=$(( s - (h * 3600) ))
384 s=$(( s - (m * 60) ))
388 [ ${m} -ge 30 ] && h=$(( h + 1 ))
389 [ ${d} -gt 1 ] && ds="days"
390 [ ${h} -gt 1 ] && hs="hours"
393 ret="${d} ${ds} and ${h} ${hs}"
399 [ ${s} -ge 30 ] && m=$(( m + 1 ))
400 [ ${h} -gt 1 ] && hs="hours"
401 [ ${m} -gt 1 ] && ms="minutes"
404 ret="${h} ${hs} and ${m} ${ms}"
410 [ ${m} -gt 1 ] && ms="minutes"
411 [ ${s} -gt 1 ] && ss="seconds"
414 ret="${m} ${ms} and ${s} ${ss}"
419 [ ${s} -gt 1 ] && ss="seconds"
427 # -----------------------------------------------------------------------------
432 if [ "${SEND_EMAIL}" = "YES" ]
440 info "sent email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}'"
443 error "failed to send email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}' with error code ${ret}."
451 # -----------------------------------------------------------------------------
455 local apptoken="${1}" usertokens="${2}" when="${3}" url="${4}" status="${5}" title="${6}" message="${7}" httpcode sent=0 user priority
457 if [ "${SEND_PUSHOVER}" = "YES" -a ! -z "${apptoken}" -a ! -z "${usertokens}" -a ! -z "${title}" -a ! -z "${message}" ]
460 # https://pushover.net/api
463 CLEAR) priority=-1;; # low priority: no sound or vibration
464 WARNING) priotity=0;; # normal priority: respect quiet hours
465 CRITICAL) priority=1;; # high priority: bypass quiet hours
466 *) priority=-2;; # lowest priority: no notification at all
469 for user in ${usertokens}
471 httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null \
472 --form-string "token=${apptoken}" \
473 --form-string "user=${user}" \
474 --form-string "html=1" \
475 --form-string "title=${title}" \
476 --form-string "message=${message}" \
477 --form-string "timestamp=${when}" \
478 --form-string "url=${url}" \
479 --form-string "url_title=Open netdata dashboard to view the alarm" \
480 --form-string "priority=${priority}" \
481 https://api.pushover.net/1/messages.json)
483 if [ "${httpcode}" == "200" ]
485 info "sent pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}'"
488 error "failed to send pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
492 [ ${sent} -gt 0 ] && return 0
498 # -----------------------------------------------------------------------------
502 local userapikey="${1}" recipients="${2}" message="${3}" title="${4}" httpcode sent=0 user
503 if [ "${SEND_PUSHBULLET}" = "YES" -a ! -z "${userapikey}" -a ! -z "${recipients}" -a ! -z "${message}" -a ! -z "${title}" ]
505 #https://docs.pushbullet.com/#create-push
506 for user in ${recipients}
508 httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null \
509 --header 'Access-Token: '$userapikey'' \
510 --header 'Content-Type: application/json' \
511 --data-binary @<(cat <<EOF
512 {"title": "${title}",
515 "body": "$( echo -n ${message})"}
517 ) "https://api.pushbullet.com/v2/pushes" -X POST)
519 if [ "${httpcode}" == "200" ]
521 echo >&2 "${me}: Sent pushbullet notification for: ${host} ${chart}.${name} is ${status} to '${user}'"
524 echo >&2 "${me}: Failed to send pushbullet notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
528 [ ${sent} -gt 0 ] && return 0
534 # -----------------------------------------------------------------------------
538 local bottoken="${1}" chatids="${2}" message="${3}" httpcode sent=0 chatid disableNotification=""
540 if [ "${status}" = "CLEAR" ]; then disableNotification="--data-urlencode disable_notification=true"; fi
542 if [ "${SEND_TELEGRAM}" = "YES" -a ! -z "${bottoken}" -a ! -z "${chatids}" -a ! -z "${message}" ];
544 for chatid in ${chatids}
546 # https://core.telegram.org/bots/api#sendmessage
547 httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null ${disableNotification} \
548 --data-urlencode "parse_mode=HTML" \
549 --data-urlencode "disable_web_page_preview=true" \
550 --data-urlencode "text=$message" \
551 "https://api.telegram.org/bot${bottoken}/sendMessage?chat_id=$chatid")
553 if [ "${httpcode}" == "200" ]
555 info "sent telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}'"
557 elif [ "${httpcode}" == "401" ]
559 error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}': Wrong bot token."
561 error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}' with HTTP error code ${httpcode}."
565 [ ${sent} -gt 0 ] && return 0
571 # -----------------------------------------------------------------------------
575 local webhook="${1}" channels="${2}" httpcode sent=0 channel color payload
577 [ "${SEND_SLACK}" != "YES" ] && return 1
580 WARNING) color="warning" ;;
581 CRITICAL) color="danger" ;;
582 CLEAR) color="good" ;;
583 *) color="#777777" ;;
586 for channel in ${channels}
590 "channel": "#${channel}",
591 "username": "netdata on ${host}",
592 "icon_url": "${images_base_url}/images/seo-performance-128.png",
593 "text": "${host} ${status_message}, \`${chart}\` (_${family}_), *${alarm}*",
596 "fallback": "${alarm} - ${chart} (${family}) - ${info}",
599 "title_link": "${goto_url}",
607 "title": "${family}",
611 "thumb_url": "${image}",
612 "footer": "<${goto_url}|${host}>",
620 httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null -X POST --data-urlencode "payload=${payload}" "${webhook}")
621 if [ "${httpcode}" == "200" ]
623 info "sent slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
626 error "failed to send slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
630 [ ${sent} -gt 0 ] && return 0
636 # -----------------------------------------------------------------------------
637 # prepare the content of the notification
639 # the url to send the user on click
640 urlencode "${NETDATA_REGISTRY_HOSTNAME}" >/dev/null; url_host="${REPLY}"
641 urlencode "${chart}" >/dev/null; url_chart="${REPLY}"
642 urlencode "${family}" >/dev/null; url_family="${REPLY}"
643 urlencode "${name}" >/dev/null; url_name="${REPLY}"
644 goto_url="${NETDATA_REGISTRY_URL}/goto-host-from-alarm.html?host=${url_host}&chart=${url_chart}&family=${url_family}&alarm=${url_name}&alarm_unique_id=${unique_id}&alarm_id=${alarm_id}&alarm_event_id=${event_id}"
646 # the severity of the alarm
649 # the time the alarm was raised
650 duration4human ${duration} >/dev/null; duration_txt="${REPLY}"
651 duration4human ${non_clear_duration} >/dev/null; non_clear_duration_txt="${REPLY}"
652 raised_for="(was ${old_status,,} for ${duration_txt})"
654 # the key status message
655 status_message="status unknown"
657 # the color of the alarm
661 alarm="${name//_/ } = ${value} ${units}"
663 # the image of the alarm
664 image="${images_base_url}/images/seo-performance-128.png"
666 # prepare the title based on status
669 image="${images_base_url}/images/alert-128-red.png"
670 status_message="is critical"
675 image="${images_base_url}/images/alert-128-orange.png"
676 status_message="needs attention"
681 image="${images_base_url}/images/check-mark-2-128-green.png"
682 status_message="recovered"
685 # don't show the value when the status is CLEAR
686 # for certain alarms, this value might not have any meaning
687 alarm="${name//_/ } ${raised_for}"
691 if [ "${status}" = "CLEAR" ]
693 severity="Recovered from ${old_status}"
694 if [ $non_clear_duration -gt $duration ]
696 raised_for="(alarm was raised for ${non_clear_duration_txt})"
699 elif [ "${old_status}" = "WARNING" -a "${status}" = "CRITICAL" ]
701 severity="Escalated to ${status}"
702 if [ $non_clear_duration -gt $duration ]
704 raised_for="(alarm is raised for ${non_clear_duration_txt})"
707 elif [ "${old_status}" = "CRITICAL" -a "${status}" = "WARNING" ]
709 severity="Demoted to ${status}"
710 if [ $non_clear_duration -gt $duration ]
712 raised_for="(alarm is raised for ${non_clear_duration_txt})"
719 # prepare HTML versions of elements
721 [ ! -z "${info}" ] && info_html=" <small><br/>${info}</small>"
724 [ ! -z "${raised_for}" ] && raised_for_html="<br/><small>${raised_for}</small>"
726 # -----------------------------------------------------------------------------
727 # send the slack notification
729 # slack aggregates posts from the same username
730 # so we use "${host} ${status}" as the bot username, to make them diff
732 send_slack "${SLACK_WEBHOOK_URL}" "${to_slack}"
735 # -----------------------------------------------------------------------------
736 # send the pushover notification
738 send_pushover "${PUSHOVER_APP_TOKEN}" "${to_pushover}" "${when}" "${goto_url}" "${status}" "${host} ${status_message} - ${name//_/ } - ${chart}" "
739 <font color=\"${color}\"><b>${alarm}</b></font>${info_html}<br/>
740 <small><b>${chart}</b><br/>Chart<br/> </small>
741 <small><b>${family}</b><br/>Family<br/> </small>
742 <small><b>${severity}</b><br/>Severity<br/> </small>
743 <small><b>${date}${raised_for_html}</b><br/>Time<br/> </small>
744 <a href=\"${goto_url}\">View Netdata</a><br/>
745 <small><small>The source of this alarm is line ${src}</small></small>
750 # -----------------------------------------------------------------------------
751 # send the pushbullet notification
753 pushbullet_message="${alarm} \n
754 Severity: ${severity} \n
757 To View Netdata go to: ${goto_url} \n
758 The source of this alarm is line ${src}"
759 pushbullet_title="${status} at ${host} ${status_message} - ${name//_/ } - ${chart}}"
760 send_pushbullet "${PUSHBULLET_ACCESS_TOKEN}" "${to_pushbullet}" "$pushbullet_message" "$pushbullet_title"
764 # -----------------------------------------------------------------------------
765 # send the telegram.org message
767 # https://core.telegram.org/bots/api#formatting-options
768 send_telegram "${TELEGRAM_BOT_TOKEN}" "${to_telegram}" "${host} ${status_message} - <b>${name//_/ }</b>
770 <a href=\"${goto_url}\">${alarm}</a>
775 # -----------------------------------------------------------------------------
780 Subject: ${host} ${status_message} - ${name//_/ } - ${chart}
781 Content-Type: text/html
783 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
784 <html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
785 <body style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; width: 100% !important; min-height: 100%; line-height: 1.6; background: #f6f6f6; margin:0; padding: 0;">
789 <td style="vertical-align: top;" valign="top"></td>
790 <td width="700" style="vertical-align: top; display: block !important; max-width: 700px !important; clear: both !important; margin: 0 auto; padding: 0;" valign="top">
791 <div style="max-width: 700px; display: block; margin: 0 auto; padding: 20px;">
792 <table width="100%" cellpadding="0" cellspacing="0" style="background: #fff; border: 1px solid #e9e9e9;">
795 <td bgcolor="#eee" style="padding: 5px 20px 5px 20px; background-color: #eee;">
796 <div style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 20px; color: #777; font-weight: bold;">netdata notification</div>
800 <td bgcolor="${color}" style="font-size: 16px; vertical-align: top; font-weight: 400; text-align: center; margin: 0; padding: 10px; color: #ffffff; background: ${color} !important; border: 1px solid ${color}; border-top-color: ${color};" align="center" valign="top">
801 <h1 style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-weight: 400; margin: 0;">${host} ${status_message}</h1>
805 <td style="vertical-align: top;" valign="top">
806 <div style="margin: 0; padding: 20px; max-width: 700px;">
807 <table width="100%" cellpadding="0" cellspacing="0" style="max-width:700px">
810 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 18px; vertical-align: top; margin: 0; padding:0 0 20px;" align="left" valign="top">
811 <span>${chart}</span>
812 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Chart</span>
815 <tr style="margin: 0; padding: 0;">
816 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 18px; vertical-align: top; margin: 0; padding: 0 0 20px;" align="left" valign="top">
817 <span><b>${alarm}</b>${info_html}</span>
818 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Alarm</span>
822 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 18px; vertical-align: top; margin: 0; padding: 0 0 20px;" align="left" valign="top">
823 <span>${family}</span>
824 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Family</span>
827 <tr style="margin: 0; padding: 0;">
828 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 18px; vertical-align: top; margin: 0; padding: 0 0 20px;" align="left" valign="top">
829 <span>${severity}</span>
830 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Severity</span>
833 <tr style="margin: 0; padding: 0;">
834 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 18px; vertical-align: top; margin: 0; padding: 0 0 20px;" align="left" valign="top"><span>${date}</span>
835 <span>${raised_for_html}</span> <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Time</span>
838 <tr style="margin: 0; padding: 0;">
839 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 18px; vertical-align: top; margin: 0; padding: 0 0 20px;">
840 <a href="${goto_url}" style="font-size: 14px; color: #ffffff; text-decoration: none; line-height: 1.5; font-weight: bold; text-align: center; display: inline-block; text-transform: capitalize; background: #35568d; border-width: 1px; border-style: solid; border-color: #2b4c86; margin: 0; padding: 10px 15px;" target="_blank">View Netdata</a>
843 <tr style="text-align: center; margin: 0; padding: 0;">
844 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 11px; vertical-align: top; margin: 0; padding: 10px 0 0 0; color: #666666;" align="center" valign="bottom">The source of this alarm is line <code>${src}</code>
847 <tr style="text-align: center; margin: 0; padding: 0;">
848 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 12px; vertical-align: top; margin:0; padding: 20px 0 0 0; color: #666666; border-top: 1px solid #f0f0f0;" align="center" valign="bottom">Sent by
849 <a href="https://mynetdata.io/" target="_blank">netdata</a>, the real-time performance monitoring.
870 # -----------------------------------------------------------------------------
873 # we did send something
874 [ ${SENT_EMAIL} -eq 0 -o ${SENT_PUSHOVER} -eq 0 -o ${SENT_TELEGRAM} -eq 0 -o ${SENT_SLACK} -eq 0 -o ${SENT_PUSHBULLET} -eq 0 ] && exit 0
876 # we did not send anything