mirror of https://github.com/Icinga/icinga2.git
Notification#BeginExecuteNotification(): track state change notifications
This commit is contained in:
parent
2d167ccd28
commit
b25ba7a316
|
@ -452,6 +452,16 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
|
|||
/* collect all notified users */
|
||||
allNotifiedUsers.insert(user);
|
||||
|
||||
switch (type) {
|
||||
case NotificationProblem:
|
||||
case NotificationRecovery: {
|
||||
auto [host, service] = GetHostService(checkable);
|
||||
GetLastNotifiedStatePerUser()->Set(userName, service ? service->GetState() : host->GetState());
|
||||
}
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
||||
/* store all notified users for later recovery checks */
|
||||
if (type == NotificationProblem && !notifiedProblemUsers->Contains(userName))
|
||||
notifiedProblemUsers->Add(userName);
|
||||
|
|
|
@ -90,6 +90,10 @@ class Notification : CustomVarObject < NotificationNameComposer
|
|||
default {{{ return 0; }}}
|
||||
};
|
||||
|
||||
[state, no_user_view, no_user_modify] Dictionary::Ptr last_notified_state_per_user {
|
||||
default {{{ return new Dictionary(); }}}
|
||||
};
|
||||
|
||||
[config, navigation] name(Endpoint) command_endpoint (CommandEndpointRaw) {
|
||||
navigate {{{
|
||||
return Endpoint::GetByName(GetCommandEndpointRaw());
|
||||
|
|
Loading…
Reference in New Issue