diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-03-14 15:48:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 15:48:00 +0200 |
commit | c367788fc027a2696ea712f85aebb5db9d158de8 (patch) | |
tree | f4bfd42ba07b151de24c3fde544146c6dce805d7 | |
parent | 4267a14c4d55b288904155346c275c08b805da20 (diff) |
Delay removed event for 60 seconds after the chart's last collected time (#12388)
* delay removed event for 60 seconds
* change check
-rw-r--r-- | health/health.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/health/health.c b/health/health.c index d95bcee121..f29d07c2fd 100644 --- a/health/health.c +++ b/health/health.c @@ -747,8 +747,11 @@ void *health_main(void *ptr) { if (update_disabled_silenced(host, rc)) continue; + // create an alert removed event if the chart is obsolete and + // has stopped being collected for 60 seconds if (unlikely(rc->rrdset && rc->status != RRDCALC_STATUS_REMOVED && - rrdset_flag_check(rc->rrdset, RRDSET_FLAG_OBSOLETE))) { + rrdset_flag_check(rc->rrdset, RRDSET_FLAG_OBSOLETE) && + now > (rc->rrdset->last_collected_time.tv_sec + 60))) { if (!rrdcalc_isrepeating(rc)) { time_t now = now_realtime_sec(); ALARM_ENTRY *ae = health_create_alarm_entry( |