I have a query that I run to see if I have several nodes that are unable to be polled. This usually indicates a problem with my APE. I currently have it notifying me when a node hasn't been polled in 5 minutes, but I would like to alert if the number gets over 5 for a poller. This way I don't get notified on 1 or 2 that are having issues, but I do get notices if it appears to be an APE issue.
Any suggestions?
Below is my code
SELECT DISTINCT
count(nodes.Caption) as [Cannot Poll]
,e.servername
FROM orion.Nodes as [Nodes]
join orion.statusinfo as s on nodes.status = s.statusid
join orion.Engines as e on nodes.EngineID = e.EngineID
WHERE (
Nodes.Status = '1'
AND (Nodes.LastSystemUpTimePollUtc < ADDDATE('minute', -5, GETUTCDATE()))
AND Nodes.ObjectSubType <> 'ICMP'
)
group by e.servername
order by servername