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 # - slack.com notifications
20 # - telegram.org notifications
23 export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
26 # -----------------------------------------------------------------------------
28 PROGRAM_NAME="$(basename "${0}")"
31 date "+%Y-%m-%d %H:%M:%S"
38 echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${*}"
61 [ $debug -eq 1 ] && log DEBUG "${@}"
64 # -----------------------------------------------------------------------------
66 # check for BASH v4+ (required for associative arrays)
67 [ $(( ${BASH_VERSINFO[0]} )) -lt 4 ] && \
68 fatal "BASH version 4 or later is required (this is ${BASH_VERSION})."
70 # -----------------------------------------------------------------------------
71 # defaults to allow running this script by hand
73 NETDATA_CONFIG_DIR="${NETDATA_CONFIG_DIR-/etc/netdata}"
74 NETDATA_CACHE_DIR="${NETDATA_CACHE_DIR-/var/cache/netdata}"
75 [ -z "${NETDATA_REGISTRY_URL}" ] && NETDATA_REGISTRY_URL="https://registry.my-netdata.io"
76 [ -z "${NETDATA_HOSTNAME}" ] && NETDATA_HOSTNAME="$(hostname)"
77 [ -z "${NETDATA_REGISTRY_HOSTNAME}" ] && NETDATA_REGISTRY_HOSTNAME="${NETDATA_HOSTNAME}"
79 # -----------------------------------------------------------------------------
80 # parse command line parameters
82 roles="${1}" # the roles that should be notified for this event
83 host="${2}" # the host generated this event
84 unique_id="${3}" # the unique id of this event
85 alarm_id="${4}" # the unique id of the alarm that generated this event
86 event_id="${5}" # the incremental id of the event, for this alarm id
87 when="${6}" # the timestamp this event occurred
88 name="${7}" # the name of the alarm, as given in netdata health.d entries
89 chart="${8}" # the name of the chart (type.id)
90 family="${9}" # the family of the chart
91 status="${10}" # the current status : REMOVED, UNITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
92 old_status="${11}" # the previous status: REMOVED, UNITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
93 value="${12}" # the current value of the alarm
94 old_value="${13}" # the previous value of the alarm
95 src="${14}" # the line number and file the alarm has been configured
96 duration="${15}" # the duration in seconds of the previous alarm state
97 non_clear_duration="${16}" # the total duration in seconds this is/was non-clear
98 units="${17}" # the units of the value
99 info="${18}" # a short description of the alarm
101 # -----------------------------------------------------------------------------
102 # screen statuses we don't need to send a notification
104 # don't do anything if this is not WARNING, CRITICAL or CLEAR
105 if [ "${status}" != "WARNING" -a "${status}" != "CRITICAL" -a "${status}" != "CLEAR" ]
107 info "not sending notification for ${status} on '${chart}.${name}'"
111 # don't do anything if this is CLEAR, but it was not WARNING or CRITICAL
112 if [ "${old_status}" != "WARNING" -a "${old_status}" != "CRITICAL" -a "${status}" = "CLEAR" ]
114 info "not sending notification for ${status} on '${chart}.${name}' (last status was ${old_status})"
118 # -----------------------------------------------------------------------------
121 # By default fetch images from the global public registry.
122 # This is required by default, since all notification methods need to download
123 # images via the Internet, and private registries might not be reachable.
124 # This can be overwritten at the configuration file.
125 images_base_url="https://registry.my-netdata.io"
128 # if empty they will be searched in the system path
132 # enable / disable features
140 DEFAULT_RECIPIENT_SLACK=
141 declare -A role_recipients_slack=()
145 DEFAULT_RECIPIENT_PUSHOVER=
146 declare -A role_recipients_pushover=()
150 DEFAULT_RECIPIENT_TELEGRAM=
151 declare -A role_recipients_telegram=()
154 DEFAULT_RECIPIENT_EMAIL="root"
155 declare -A role_recipients_email=()
157 # load the user configuration
158 # this will overwrite the variables above
159 if [ -f "${NETDATA_CONFIG_DIR}/health_alarm_notify.conf" ]
161 source "${NETDATA_CONFIG_DIR}/health_alarm_notify.conf"
164 # -----------------------------------------------------------------------------
165 # filter a recipient based on alarm event severity
167 filter_recipient_by_criticality() {
168 local method="${1}" x="${2}" r s
171 r="${x/|*/}" # the recipient
172 s="${x/*|/}" # the severity required for notifying this recipient
174 # no severity filtering for this person
175 [ "${r}" = "${s}" ] && return 0
177 # the severity is invalid
179 [ "${s}" != "CRITICAL" ] && return 0
181 # the new or the old status matches the severity
182 if [ "${s}" = "${status}" -o "${s}" = "${old_status}" ]
184 [ ! -d "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}" ] && \
185 mkdir -p "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}"
187 # we need to keep track of the notifications we sent
188 # so that the same user will receive the recovery
189 # even if old_status does not match the required severity
190 touch "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}/${alarm_id}"
194 # it is a cleared alarm we have sent notification for
195 if [ "${status}" != "WARNING" -a "${status}" != "CRITICAL" -a -f "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}/${alarm_id}" ]
197 rm "${NETDATA_CACHE_DIR}/alarm-notify/${method}/${r}/${alarm_id}"
204 # -----------------------------------------------------------------------------
205 # find the recipients' addresses per method
207 declare -A arr_slack=()
208 declare -A arr_pushover=()
209 declare -A arr_telegram=()
210 declare -A arr_email=()
212 # netdata may call us with multiple roles, and roles may have multiple but
213 # overlapping recipients - so, here we find the unique recipients.
214 for x in ${roles//,/ }
216 # the roles 'silent' and 'disabled' mean:
217 # don't send a notification for this role
218 [ "${x}" = "silent" -o "${x}" = "disabled" ] && continue
221 a="${role_recipients_email[${x}]}"
222 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_EMAIL}"
225 [ "${r}" != "disabled" ] && filter_recipient_by_criticality email "${r}" && arr_email[${r/|*/}]="1"
229 a="${role_recipients_pushover[${x}]}"
230 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_PUSHOVER}"
233 [ "${r}" != "disabled" ] && filter_recipient_by_criticality pushover "${r}" && arr_pushover[${r/|*/}]="1"
237 a="${role_recipients_telegram[${x}]}"
238 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_TELEGRAM}"
241 [ "${r}" != "disabled" ] && filter_recipient_by_criticality telegram "${r}" && arr_telegram[${r/|*/}]="1"
245 a="${role_recipients_slack[${x}]}"
246 [ -z "${a}" ] && a="${DEFAULT_RECIPIENT_SLACK}"
249 [ "${r}" != "disabled" ] && filter_recipient_by_criticality slack "${r}" && arr_slack[${r/|*/}]="1"
253 # build the list of slack recipients (channels)
254 to_slack="${!arr_slack[*]}"
255 [ -z "${to_slack}" ] && SEND_SLACK="NO"
257 # build the list of pushover recipients (user tokens)
258 to_pushover="${!arr_pushover[*]}"
259 [ -z "${to_pushover}" ] && SEND_PUSHOVER="NO"
261 # check array of telegram recipients (chat ids)
262 to_telegram="${!arr_telegram[*]}"
263 [ -z "${to_telegram}" ] && SEND_TELEGRAM="NO"
265 # build the list of email recipients (email addresses)
267 for x in "${!arr_email[@]}"
269 [ ! -z "${to_email}" ] && to_email="${to_email}, "
270 to_email="${to_email}${x}"
272 [ -z "${to_email}" ] && SEND_EMAIL="NO"
275 # -----------------------------------------------------------------------------
276 # verify the delivery methods supported
279 [ -z "${SLACK_WEBHOOK_URL}" ] && SEND_SLACK="NO"
282 [ -z "${PUSHOVER_APP_TOKEN}" ] && SEND_PUSHOVER="NO"
285 [ -z "${TELEGRAM_BOT_TOKEN}" ] && SEND_TELEGRAM="NO"
287 if [ \( "${SEND_PUSHOVER}" = "YES" -o "${SEND_SLACK}" = "YES" -o "${SEND_TELEGRAM}" = "YES" \) -a -z "${curl}" ]
289 curl="$(which curl 2>/dev/null || command -v curl 2>/dev/null)"
298 if [ "${SEND_EMAIL}" = "YES" -a -z "${sendmail}" ]
300 sendmail="$(which sendmail 2>/dev/null || command -v sendmail 2>/dev/null)"
301 [ -z "${sendmail}" ] && SEND_EMAIL="NO"
304 # check that we have at least a method enabled
305 if [ "${SEND_EMAIL}" != "YES" -a "${SEND_PUSHOVER}" != "YES" -a "${SEND_TELEGRAM}" != "YES" -a "${SEND_SLACK}" != "YES" ]
307 fatal "All notification methods are disabled. Not sending a notification."
310 # -----------------------------------------------------------------------------
311 # get the system hostname
313 [ -z "${host}" ] && host="${NETDATA_HOSTNAME}"
314 [ -z "${host}" ] && host="${NETDATA_REGISTRY_HOSTNAME}"
315 [ -z "${host}" ] && host="$(hostname 2>/dev/null)"
317 # -----------------------------------------------------------------------------
318 # get the date the alarm happened
320 date="$(date --date=@${when} 2>/dev/null)"
321 [ -z "${date}" ] && date="$(date 2>/dev/null)"
323 # -----------------------------------------------------------------------------
324 # URL encode a string
327 local string="${1}" strlen encoded pos c o
330 for (( pos=0 ; pos<strlen ; pos++ ))
339 printf -v o '%%%02x' "'$c"
349 # -----------------------------------------------------------------------------
350 # convert a duration in seconds, to a human readable duration
351 # using DAYS, MINUTES, SECONDS
354 local s="${1}" d=0 h=0 m=0 ds="day" hs="hour" ms="minute" ss="second" ret
356 s=$(( s - (d * 86400) ))
358 s=$(( s - (h * 3600) ))
360 s=$(( s - (m * 60) ))
364 [ ${m} -ge 30 ] && h=$(( h + 1 ))
365 [ ${d} -gt 1 ] && ds="days"
366 [ ${h} -gt 1 ] && hs="hours"
369 ret="${d} ${ds} and ${h} ${hs}"
375 [ ${s} -ge 30 ] && m=$(( m + 1 ))
376 [ ${h} -gt 1 ] && hs="hours"
377 [ ${m} -gt 1 ] && ms="minutes"
380 ret="${h} ${hs} and ${m} ${ms}"
386 [ ${m} -gt 1 ] && ms="minutes"
387 [ ${s} -gt 1 ] && ss="seconds"
390 ret="${m} ${ms} and ${s} ${ss}"
395 [ ${s} -gt 1 ] && ss="seconds"
403 # -----------------------------------------------------------------------------
408 if [ "${SEND_EMAIL}" = "YES" ]
416 info "sent email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}'"
419 error "failed to send email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}' with error code ${ret}."
427 # -----------------------------------------------------------------------------
431 local apptoken="${1}" usertokens="${2}" when="${3}" url="${4}" status="${5}" title="${6}" message="${7}" httpcode sent=0 user priority
433 if [ "${SEND_PUSHOVER}" = "YES" -a ! -z "${apptoken}" -a ! -z "${usertokens}" -a ! -z "${title}" -a ! -z "${message}" ]
436 # https://pushover.net/api
439 CLEAR) priority=-1;; # low priority: no sound or vibration
440 WARNING) priotity=0;; # normal priority: respect quiet hours
441 CRITICAL) priority=1;; # high priority: bypass quiet hours
442 *) priority=-2;; # lowest priority: no notification at all
445 for user in ${usertokens}
447 httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null \
448 --form-string "token=${apptoken}" \
449 --form-string "user=${user}" \
450 --form-string "html=1" \
451 --form-string "title=${title}" \
452 --form-string "message=${message}" \
453 --form-string "timestamp=${when}" \
454 --form-string "url=${url}" \
455 --form-string "url_title=Open netdata dashboard to view the alarm" \
456 --form-string "priority=${priority}" \
457 https://api.pushover.net/1/messages.json)
459 if [ "${httpcode}" == "200" ]
461 info "sent pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}'"
464 error "failed to send pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
468 [ ${sent} -gt 0 ] && return 0
475 # -----------------------------------------------------------------------------
479 local bottoken="${1}" chatids="${2}" message="${3}" httpcode sent=0 chatid disableNotification=""
481 if [ "${status}" = "CLEAR" ]; then disableNotification="--data-urlencode disable_notification=true"; fi
483 if [ "${SEND_TELEGRAM}" = "YES" -a ! -z "${bottoken}" -a ! -z "${chatids}" -a ! -z "${message}" ];
485 for chatid in ${chatids}
487 # https://core.telegram.org/bots/api#sendmessage
488 httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null ${disableNotification} \
489 --data-urlencode "parse_mode=HTML" \
490 --data-urlencode "disable_web_page_preview=true" \
491 --data-urlencode "text=$message" \
492 "https://api.telegram.org/bot${bottoken}/sendMessage?chat_id=$chatid")
494 if [ "${httpcode}" == "200" ]
496 info "sent telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}'"
498 elif [ "${httpcode}" == "401" ]
500 error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}': Wrong bot token."
502 error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}' with HTTP error code ${httpcode}."
506 [ ${sent} -gt 0 ] && return 0
512 # -----------------------------------------------------------------------------
516 local webhook="${1}" channels="${2}" httpcode sent=0 channel color payload
518 [ "${SEND_SLACK}" != "YES" ] && return 1
521 WARNING) color="warning" ;;
522 CRITICAL) color="danger" ;;
523 CLEAR) color="good" ;;
524 *) color="#777777" ;;
527 for channel in ${channels}
531 "channel": "#${channel}",
532 "username": "netdata on ${host}",
533 "icon_url": "${images_base_url}/images/seo-performance-128.png",
534 "text": "${host} ${status_message}, \`${chart}\` (_${family}_), *${alarm}*",
537 "fallback": "${alarm} - ${chart} (${family}) - ${info}",
540 "title_link": "${goto_url}",
548 "title": "${family}",
552 "thumb_url": "${image}",
553 "footer": "<${goto_url}|${host}>",
561 httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null -X POST --data-urlencode "payload=${payload}" "${webhook}")
562 if [ "${httpcode}" == "200" ]
564 info "sent slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
567 error "failed to send slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
571 [ ${sent} -gt 0 ] && return 0
577 # -----------------------------------------------------------------------------
578 # prepare the content of the notification
580 # the url to send the user on click
581 urlencode "${NETDATA_REGISTRY_HOSTNAME}" >/dev/null; url_host="${REPLY}"
582 urlencode "${chart}" >/dev/null; url_chart="${REPLY}"
583 urlencode "${family}" >/dev/null; url_family="${REPLY}"
584 urlencode "${name}" >/dev/null; url_name="${REPLY}"
585 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}"
587 # the severity of the alarm
590 # the time the alarm was raised
591 duration4human ${duration} >/dev/null; duration_txt="${REPLY}"
592 duration4human ${non_clear_duration} >/dev/null; non_clear_duration_txt="${REPLY}"
593 raised_for="(was ${old_status,,} for ${duration_txt})"
595 # the key status message
596 status_message="status unknown"
598 # the color of the alarm
602 alarm="${name//_/ } = ${value} ${units}"
604 # the image of the alarm
605 image="${images_base_url}/images/seo-performance-128.png"
607 # prepare the title based on status
610 image="${images_base_url}/images/alert-128-red.png"
611 status_message="is critical"
616 image="${images_base_url}/images/alert-128-orange.png"
617 status_message="needs attention"
622 image="${images_base_url}/images/check-mark-2-128-green.png"
623 status_message="recovered"
626 # don't show the value when the status is CLEAR
627 # for certain alarms, this value might not have any meaning
628 alarm="${name//_/ } ${raised_for}"
632 if [ "${status}" = "CLEAR" ]
634 severity="Recovered from ${old_status}"
635 if [ $non_clear_duration -gt $duration ]
637 raised_for="(alarm was raised for ${non_clear_duration_txt})"
640 elif [ "${old_status}" = "WARNING" -a "${status}" = "CRITICAL" ]
642 severity="Escalated to ${status}"
643 if [ $non_clear_duration -gt $duration ]
645 raised_for="(alarm is raised for ${non_clear_duration_txt})"
648 elif [ "${old_status}" = "CRITICAL" -a "${status}" = "WARNING" ]
650 severity="Demoted to ${status}"
651 if [ $non_clear_duration -gt $duration ]
653 raised_for="(alarm is raised for ${non_clear_duration_txt})"
660 # prepare HTML versions of elements
662 [ ! -z "${info}" ] && info_html=" <small><br/>${info}</small>"
665 [ ! -z "${raised_for}" ] && raised_for_html="<br/><small>${raised_for}</small>"
667 # -----------------------------------------------------------------------------
668 # send the slack notification
670 # slack aggregates posts from the same username
671 # so we use "${host} ${status}" as the bot username, to make them diff
673 send_slack "${SLACK_WEBHOOK_URL}" "${to_slack}"
676 # -----------------------------------------------------------------------------
677 # send the pushover notification
679 send_pushover "${PUSHOVER_APP_TOKEN}" "${to_pushover}" "${when}" "${goto_url}" "${status}" "${host} ${status_message} - ${name//_/ } - ${chart}" "
680 <font color=\"${color}\"><b>${alarm}</b></font>${info_html}<br/>
681 <small><b>${chart}</b><br/>Chart<br/> </small>
682 <small><b>${family}</b><br/>Family<br/> </small>
683 <small><b>${severity}</b><br/>Severity<br/> </small>
684 <small><b>${date}${raised_for_html}</b><br/>Time<br/> </small>
685 <a href=\"${goto_url}\">View Netdata</a><br/>
686 <small><small>The source of this alarm is line ${src}</small></small>
691 # -----------------------------------------------------------------------------
692 # send the telegram.org message
694 # https://core.telegram.org/bots/api#formatting-options
695 send_telegram "${TELEGRAM_BOT_TOKEN}" "${to_telegram}" "${host} ${status_message} - <b>${name//_/ }</b>
697 <a href=\"${goto_url}\">${alarm}</a>
702 # -----------------------------------------------------------------------------
707 Subject: ${host} ${status_message} - ${name//_/ } - ${chart}
708 Content-Type: text/html
710 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
711 <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;">
712 <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;">
716 <td style="vertical-align: top;" valign="top"></td>
717 <td width="700" style="vertical-align: top; display: block !important; max-width: 700px !important; clear: both !important; margin: 0 auto; padding: 0;" valign="top">
718 <div style="max-width: 700px; display: block; margin: 0 auto; padding: 20px;">
719 <table width="100%" cellpadding="0" cellspacing="0" style="background: #fff; border: 1px solid #e9e9e9;">
722 <td bgcolor="#eee" style="padding: 5px 20px 5px 20px; background-color: #eee;">
723 <div style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 20px; color: #777; font-weight: bold;">netdata notification</div>
727 <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">
728 <h1 style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-weight: 400; margin: 0;">${host} ${status_message}</h1>
732 <td style="vertical-align: top;" valign="top">
733 <div style="margin: 0; padding: 20px; max-width: 700px;">
734 <table width="100%" cellpadding="0" cellspacing="0" style="max-width:700px">
737 <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">
738 <span>${chart}</span>
739 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Chart</span>
742 <tr style="margin: 0; padding: 0;">
743 <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">
744 <span><b>${alarm}</b>${info_html}</span>
745 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Alarm</span>
749 <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">
750 <span>${family}</span>
751 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Family</span>
754 <tr style="margin: 0; padding: 0;">
755 <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">
756 <span>${severity}</span>
757 <span style="display: block; color: #666666; font-size: 12px; font-weight: 300; line-height: 1; text-transform: uppercase;">Severity</span>
760 <tr style="margin: 0; padding: 0;">
761 <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>
762 <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>
765 <tr style="margin: 0; padding: 0;">
766 <td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 18px; vertical-align: top; margin: 0; padding: 0 0 20px;">
767 <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>
770 <tr style="text-align: center; margin: 0; padding: 0;">
771 <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>
774 <tr style="text-align: center; margin: 0; padding: 0;">
775 <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
776 <a href="https://mynetdata.io/" target="_blank">netdata</a>, the real-time performance monitoring.
797 # -----------------------------------------------------------------------------
800 # we did send something
801 [ ${SENT_EMAIL} -eq 0 -o ${SENT_PUSHOVER} -eq 0 -o ${SENT_TELEGRAM} -eq 0 -o ${SENT_SLACK} -eq 0 ] && exit 0
803 # we did not send anything