"# netdata configuration\n"
"#\n"
"# You can download the latest version of this file, using:\n"
+ "#\n"
"# wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf\n"
"# or\n"
"# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf\n"
ALARM_ENTRY *t;
for(t = host->health_log.alarms ; t ; t = t->next) {
if(t != ae && t->alarm_id == ae->alarm_id) {
- if(!(t->notifications & HEALTH_ENTRY_NOTIFICATIONS_UPDATED) && !t->updated_by) {
+ if(!(t->notifications & HEALTH_ENTRY_NOTIFICATIONS_UPDATED) && !t->updated_by_id) {
t->notifications |= HEALTH_ENTRY_NOTIFICATIONS_UPDATED;
- t->updated_by = ae;
+ t->updated_by_id = ae->unique_id;
+ ae->updates_id = t->unique_id;
if((t->new_status == RRDCALC_STATUS_WARNING || t->new_status == RRDCALC_STATUS_CRITICAL) &&
(t->old_status == RRDCALC_STATUS_WARNING || t->old_status == RRDCALC_STATUS_CRITICAL))
"\t\t\"status\": \"%s\",\n"
"\t\t\"old_status\": \"%s\",\n"
"\t\t\"delay\": %d,\n"
- "\t\t\"delay_up_to_timestamp\": %lu,\n",
+ "\t\t\"delay_up_to_timestamp\": %lu,\n"
+ "\t\t\"updated_by_id\": %u,\n"
+ "\t\t\"updates_id\": %u,\n",
host->hostname,
ae->unique_id,
ae->alarm_id,
rrdcalc_status2string(ae->new_status),
rrdcalc_status2string(ae->old_status),
ae->delay,
- (unsigned long)ae->delay_up_to_timestamp
+ (unsigned long)ae->delay_up_to_timestamp,
+ ae->updated_by_id,
+ ae->updates_id
);
buffer_strcat(wb, "\t\t\"value\":");
notifications: false, // when true, the browser supports notifications (may not be granted though)
last_notification_id: 0, // the id of the last alarm_log we have raised an alarm for
+ first_notification_id: 0, // the id of the first alarm_log we have seen in this session
// notifications_shown: new Array(),
server: null, // the server to connect to for fetching alarms
return;
case 'CLEAR':
- if(NETDATA.alarms.last_notification_id === 0) {
+ if(typeof entry.updates_id === 'number' && entry.updates_id < NETDATA.alarms.first_notification_id) {
// console.log('alarm ' + entry.unique_id + ' is not current');
return;
}
NETDATA.alarms.server = host;
NETDATA.alarms.last_notification_id = NETDATA.localStorageGet('last_notification_id', NETDATA.alarms.last_notification_id, null);
+ NETDATA.alarms.first_notification_id = NETDATA.alarms.last_notification_id;
if(NETDATA.alarms.onclick === null)
NETDATA.alarms.onclick = NETDATA.alarms.scrollToAlarm;