diff options
Diffstat (limited to 'health')
-rw-r--r-- | health/health_json.c | 16 | ||||
-rwxr-xr-x | health/notifications/health_alarm_notify.conf | 14 |
2 files changed, 23 insertions, 7 deletions
diff --git a/health/health_json.c b/health/health_json.c index 2a81d1c0..74a384a3 100644 --- a/health/health_json.c +++ b/health/health_json.c @@ -349,6 +349,18 @@ void health_alarms_values2json(RRDHOST *host, BUFFER *wb, int all) { rrdhost_unlock(host); } +static int have_recent_alarm(RRDHOST *host, uint32_t alarm_id, time_t mark) +{ + ALARM_ENTRY *ae = host->health_log.alarms; + + while(ae) { + if (ae->alarm_id == alarm_id && ae->unique_id > mark && + (ae->new_status != RRDCALC_STATUS_WARNING && ae->new_status != RRDCALC_STATUS_CRITICAL)) + return 1; + ae = ae->next; + } + return 0; +} void health_active_log_alarms_2json(RRDHOST *host, BUFFER *wb) { netdata_rwlock_rdlock(&host->health_log.alarm_log_rwlock); @@ -363,6 +375,10 @@ void health_active_log_alarms_2json(RRDHOST *host, BUFFER *wb) { ((ae->new_status == RRDCALC_STATUS_WARNING || ae->new_status == RRDCALC_STATUS_CRITICAL) || ((ae->old_status == RRDCALC_STATUS_WARNING || ae->old_status == RRDCALC_STATUS_CRITICAL) && ae->new_status == RRDCALC_STATUS_REMOVED))) { + + if (have_recent_alarm(host, ae->alarm_id, ae->unique_id)) + continue; + if (likely(count)) buffer_strcat(wb, ","); health_alarm_entry2json_nolock(wb, ae, host); diff --git a/health/notifications/health_alarm_notify.conf b/health/notifications/health_alarm_notify.conf index 2dab1d48..ae23180b 100755 --- a/health/notifications/health_alarm_notify.conf +++ b/health/notifications/health_alarm_notify.conf @@ -220,8 +220,8 @@ DEFAULT_RECIPIENT_EMAIL="root" # You can also have netdata add headers to the message that will # cause most e-mail clients to treat all notifications for a given # chart+alarm+host combination as a single thread. This can help -# simplify tracking of alarms, as it provides an easy wway for scripts -# to corelate messages and also will cause most clients to group all the +# simplify tracking of alarms, as it provides an easy way for scripts +# to correlate messages and also will cause most clients to group all the # messages together. This is enabled by default, uncomment the line # below if you want to disable it. #EMAIL_THREADING="NO" @@ -480,7 +480,7 @@ SEND_MSTEAM="YES" # This value will be replaced in the webhook value to publish to several channels in a same Team. # In order to get it working properly, you have to replace the value between [] ....IncomingWebhook/[___]/..... by "CHANNEL" string. DEFAULT_RECIPIENT_MSTEAM="" -# Based on the way MS Teams is working, put the differents channels here like : "CHANNEL1 CHANNEL2 ..." +# Based on the way MS Teams is working, put the different channels here like : "CHANNEL1 CHANNEL2 ..." # AT LEAST ONE CHANNEL IS MANDATORY MSTEAM_WEBHOOK_URL="" @@ -703,7 +703,7 @@ SEND_SYSLOG="NO" # A note on log levels and facilities: # # The traditional UNIX syslog mechanism has the concept of both log -# levels and facilities. A log level indicates the relaitve severity of +# levels and facilities. A log level indicates the relative severity of # the message, while a facility specifies a generic source for the message # (for example, the `mail` facility is where sendmail and postfix log # their messages). All major syslog daemons have the ability to filter @@ -762,7 +762,7 @@ DEFAULT_RECIPIENT_SYSLOG="netdata" SEND_PROWL="YES" # If a role's recipients are not configured, use the following, -# (empty = do not send a notiication for unconfigured roles) +# (empty = do not send a notification for unconfigured roles) # # Recipients for iOS push notifications are Prowl API keys. # @@ -949,7 +949,7 @@ role_recipients_irc[sysadmin]="${DEFAULT_RECIPIENT_IRC}" role_recipients_syslog[sysadmin]="${DEFAULT_RECIPIENT_SYSLOG}" -role_recipients_prowl[sysadming]="${DEFAULT_RECIPIENT_PROWL}" +role_recipients_prowl[sysadmin]="${DEFAULT_RECIPIENT_PROWL}" role_recipients_awssns[sysadmin]="${DEFAULT_RECIPIENT_AWSSNS}" @@ -1180,7 +1180,7 @@ role_recipients_syslog[proxyadmin]="${DEFAULT_RECIPIENT_SYSLOG}" role_recipients_prowl[proxyadmin]="${DEFAULT_RECIPIENT_PROWL}" -role_recipients_awssns[porxyadmin]="${DEFAULT_RECIPIENT_AWSSNS}" +role_recipients_awssns[proxyadmin]="${DEFAULT_RECIPIENT_AWSSNS}" role_recipients_custom[proxyadmin]="${DEFAULT_RECIPIENT_CUSTOM}" |