So what I'm trying to do is create an alert for when Agent Status is not equal to running, which is fine, but I also want the Alert Message to show the Agent Status Message so I can quickly see what reason the Agent is not running.
When you create the alert the fifth section allows you to configure trigger action and to show a custom message when the alert is triggered.
I can use the following built-in variable to get Agent Status but this just returns the Agent Status ID, which is no use.
${N=SwisEntity;M=AgentStatus}
What I want to be able to do, but doesn't work is this: -
${N=SwisEntity;M=AgentStatusMessage}
Looking at other forum posts I see suggestions about referring to Orion SDK Schema but I don't see how I can reference any data using SwisEntity, I've tried all the following but none of these work: -
${N=SwisEntity;M=Orion.AgentManagement.Agent.AgentStatusMessage}
${N=SwisEntity;M=AgentManagement.Agent.AgentStatusMessage}
${N=SwisEntity;M=Agent.AgentStatusMessage}
${N=SwisEntity;M=AgentStatusMessage}
So then I look to SWQL as I know from SWQL Studio that I can reference the correct information but if I use SWQL in variable, I cannot seem to pass NodeID to the WHERE clause so I cannot get it to return the correct information for Node that generated the alert.
This does nothing: -
${N=SWQL;M=SELECT OAM.AgentStatusMessage FROM Orion.AgentManagement.Agent OAM WHERE OAM.NodeId = ${N=SwisEntity;M=NodeID}}
This only resolves the NodeID but doesn't process the SWQL query: -
${N=SWQL;M=SELECT OAM.AgentStatusMessage FROM Orion.AgentManagement.Agent OAM WHERE OAM.NodeId = ${NodeID}}
So I get back this: -
${N=SWQL;M=SELECT OAM.AgentStatusMessage FROM Orion.AgentManagement.Agent OAM WHERE OAM.NodeId = 763}
If I don't use a WHERE clause the SWQL works but obviously the information returned is just from the first node, not the node that generated the alert.
${N=SWQL;M=SELECT OAM.AgentStatusMessage FROM Orion.AgentManagement.Agent OAM}
Returns: -
Agent is running
So how on earth can I get this Agent Status Message to populate in the Alert Message?
What is the point of being able to use SWQL/SQL statements in variables if you cannot pass anything into the query?
Am I missing something?
BTW I did raise a case with SolarWinds for this too but I just got a reply saying they don't support help with SWQL queries. Even though strictly speaking its not help with the query I want, I just want better documentation/syntax information to correctly construct this custom variable.
Cheers for help
Message was edited by: Anthony YatesCorrected SWQL statement