4 Replies Latest reply on Mar 20, 2017 5:44 PM by timt

    How to link a group container to node (how to create a mute_group alert)

    timt

      Hi,

       

      I am trying to create a way for users to be able to bulk mute servers in a group.  I ended up creating dynamic group queries to look for servers belonging to certain node custom properties.  I then created a custom view to list (linkable) nodes belonging a root group.  Users can now select the group and edit the group custom property group called mute_group, and set to mute.

       

      Now I need to create an advanced alert to lookup the group field if it's set to "mute_group", and at the same time, also look for other node.custom property variables.

       

      However when I try to create an advanced alert, I can't link to the group custom property to any node details.

       

      So, I am thinking of creating an advanced swql alert, however when I try to create this in swql it's giving an ambigous error. 

       

      Is there a way to link both the orion.groups and orion.nodes together by swql in the advanced swql alerting?

       

      Thanks in advance!

       

        • Re: How to link a group container to node (how to create a mute_group alert)
          tdanner

          There's no relationship defined between Orion.ContainerMembers and Orion.Nodes - this is why the alert designer doesn't offer to link them together.

           

          However, you are correct that you can use a "Custom SWQL" alert to get around that by using a custom join. Here's something to get you started:

           

          SELECT Nodes.Uri, Nodes.DisplayName FROM Orion.Nodes AS Nodes
          -------
          INNER JOIN Orion.Groups G 
               ON G.Members.MemberPrimaryID=Nodes.NodeID 
                    AND G.Members.MemberEntityType=Nodes.InstanceType
          WHERE G.CustomProperties.Comments='mute_group'
              AND Nodes.CustomProperties.City='Austin'
          

           

          This will return all nodes whose City property is "Austin" and that are members of any group whose Comments field says "mute_group". Customize for your environment.

          1 of 1 people found this helpful
            • Re: How to link a group container to node (how to create a mute_group alert)
              timt

              Ahh, I thought this would work out, as the same way the swql report builder works, but it seems like the select is static, as I can't change.  Guess this idea may not work for now.

               

              SELECT Nodes.Uri, Nodes.DisplayName, nodes.status, cp.os_admin, gcp.mute_group

              FROM Orion.Nodes AS Nodes

              ------- 

              INNER JOIN Orion.Groups G  

                   ON G.Members.MemberPrimaryID=Nodes.NodeID  

                        AND G.Members.MemberEntityType=Nodes.InstanceType

              left join orion.nodescustomproperties cp ON cp.nodeid=nodes.nodeid

              left join orion.groupcustomproperties gcp ON gcp.containerid=g.containerid