mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Load Notification objects after User and UserGroup
Notification objects can refer User and Group objects similar to how they can refer Host and Service objects, so that dependency feels quite natural. Note that for evaluating most configuration, this order doesn't really matter, the configuration will successfully evaluate in either case, the difference can be noticed mainly in more advanced configurations, for example when dynamically assigning user based on their groups. When accessing user objects from the Notification object definition (like in the following example), without this change, only groups configured directly in groups attribute of User objects are visible and those added via assign clauses in UserGroup objects are missing. With this commit, these are also visible. apply Notification "n" to Host { for (var u in get_objects(User)) { log(u.name + " -> " + Json.encode(u.groups)) } # [...] }
This commit is contained in:
parent
a65f2d6b41
commit
cc48c924ae
@ -22,6 +22,8 @@ class Notification : CustomVarObject < NotificationNameComposer
|
||||
{
|
||||
load_after Host;
|
||||
load_after Service;
|
||||
load_after User;
|
||||
load_after UserGroup;
|
||||
|
||||
[config, protected, required, navigation] name(NotificationCommand) command (CommandRaw) {
|
||||
navigate {{{
|
||||
|
Loading…
x
Reference in New Issue
Block a user