Alert only on nodes that a member of a specific group

Hi,

i want to alert on a node but only if its member of specific group.

I figured out that its not possible to filter on a group membership on a node alert.

In this post Trigger for each group member in a group? is recommend to set an custom property for these nodes, because you can filter custom properties on node alerts. But in my eyes its not more than a bad workaround, because custom properties on a node and a group membership of a node are very different ...

In our environment most nodes are member of more than one group, so I had to create a custom property for each group and set there a TRUE or FALSE for the membership or create a custom property where I set all groups e.g. comma-seperated as string ..

So therefore I tried to fix this problem with a SWQL-Query on the trigger condition:

SELECT cms.EntityID
FROM Orion.ContainerMemberSnapshots cms
JOIN Orion.Container c ON cms.ContainerID = c.ContainerID
WHERE C.Name = 'YOURGROUPNAME'

Example Output:

pastedImage_4.png

So these are the NodeID on which i want to limit this alert.

Then i created an alert with this query:

As field I used 'Use value/macro' then insert Variable and select your SWQL-Query at the bottom of the popup. Then I selected contains '${N=SwisEntity;M=NodeID}'

pastedImage_6.png

But this does not work.

The problem could be that the query returns more than one value or the condition can not be set like this or its just a logical mistake from me.

Do you have any other ideas to get this run.

Many Greetings

Dominik

Parents Reply Children
No Data