I have a powershell script written to balance the load between multiple polling servers on a regular basis but I'd like to have it exclude a polling server if it is down or the engine status is down. I have created a SWQL query that gets me the polling engines and checks for the node.status = 2 which I can use to exclude the polling server if it is actually down or the agent service is stopped but it doesn't exclude the polling engine if the Solarwinds services are stopped or the polling server is just not responding.
SWQL query is:
Select E.EngineID,E.ServerName,N.Status
From Engines E
Inner Join Nodes as N ON E.IP = N.IP_Address
Where N.Status = 2
Powershell is:
$Engines = Get-SwisData $swis 'Select E.EngineID,E.ServerName,N.Status From Orion.Engines E Inner Join Orion.Nodes as N ON E.IP = N.IP_Address Where N.Status = 2'
Is there a way to get the engine status like you get in Settings > All Settings > Polling Servers ?
Otherwise I'll have to use the Polling Completion or something as a proxy value for the polling engine status which is less exact.
Thanks
-Jim