mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
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 */
|
/* collect all notified users */
|
||||||
allNotifiedUsers.insert(user);
|
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 */
|
/* store all notified users for later recovery checks */
|
||||||
if (type == NotificationProblem && !notifiedProblemUsers->Contains(userName))
|
if (type == NotificationProblem && !notifiedProblemUsers->Contains(userName))
|
||||||
notifiedProblemUsers->Add(userName);
|
notifiedProblemUsers->Add(userName);
|
||||||
|
@ -90,6 +90,10 @@ class Notification : CustomVarObject < NotificationNameComposer
|
|||||||
default {{{ return 0; }}}
|
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) {
|
[config, navigation] name(Endpoint) command_endpoint (CommandEndpointRaw) {
|
||||||
navigate {{{
|
navigate {{{
|
||||||
return Endpoint::GetByName(GetCommandEndpointRaw());
|
return Endpoint::GetByName(GetCommandEndpointRaw());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user