Quantcast
Channel: THWACK: Discussion List - All Communities
Viewing all articles
Browse latest Browse all 16365

Orion alerting will only pull the first cell from a SQL query

$
0
0

I've got a request from one of my tech owners to alert when a node goes down, but also include information from the rest of the nodes in the cluster. I've created a test group containing 2 nodes labelled with Cluster_Number custom property.

 

Data that I want to see:

Caption           IP_Address          Cluster_Number           StatusDescription

Laptop-1         10.1.1.1                1 of 2                          Node status is Up.

Laptop-2         10.1.1.2                2 of 2                          Node status is Up.

 

I've created a SQL query I can run from SSMS that gives me the correct data:

 

select nodes.Caption, nodes.IP_Address, custom.Cluster_Number, nodes.StatusDescription

from dbo.NodesData as nodes

join dbo.NodesCustomProperties as custom on nodes.NodeID = custom.NodeID

left outer join dbo.ContainerMemberSnapshots as members on nodes.caption = members.name

left outer join dbo.Containers as containers on containers.ContainerID = members.ContainerID

where containers.Name like 'Test%'

 

When I edit the alert to include this query, I only get "Laptop-1." I've broken the query into pieces to pull all columns, which I join together in the alert using " -- " to make the data more readable:

 

${SQL: select nodes.Caption from dbo.NodesData as nodes

left outer join dbo.ContainerMemberSnapshots as members on nodes.caption = members.name

left outer join dbo.Containers as containers on containers.ContainerID = members.ContainerID

where containers.Name like 'Test%'}

 

${SQL: select nodes.IP_Address from dbo.NodesData as nodes

left outer join dbo.ContainerMemberSnapshots as members on nodes.caption = members.name

left outer join dbo.Containers as containers on containers.ContainerID = members.ContainerID

where containers.Name like 'Test%'}

 

${SQL: select custom.Cluster_Number from dbo.NodesCustomProperties as custom

join dbo.NodesData as nodes on nodes.NodeID = custom.NodeID

left outer join dbo.ContainerMemberSnapshots as members on nodes.caption = members.name

left outer join dbo.Containers as containers on containers.ContainerID = members.ContainerID

where containers.Name like 'Test%'}

 

${SQL: select nodes.StatusDescription from dbo.NodesData as nodes

left outer join dbo.ContainerMemberSnapshots as members on nodes.caption = members.name

left outer join dbo.Containers as containers on containers.ContainerID = members.ContainerID

where containers.Name like 'Test%'}

 

When the alert fires, I see this:
Laptop-1 -- 10.1.1.1 -- 1 of 2 -- Node status is Down.

 

I need to see the other group member as well. While this particular group only has 2 members, I need to be able to deploy this alert in a variety of environments where clusters may have several members. How can I get Orion to display more than just the first line from the query?


Viewing all articles
Browse latest Browse all 16365

Trending Articles