So I have very little SQL experience, below is the core part of my SWQL I am trying to run. This gives me exactly what I want, but it is polling all nodes. I need to count the number of times a node went down in the past hour and/or past day.
SELECT NodeName, T1.DownTime AS HoursDown
FROM (SELECT COUNT(EventTime) AS DownTime, NetObjectID, NetworkNode
FROM Orion.Events
WHERE (EventType=1)
GROUP BY NetObjectID, NetworkNode) AS T1 INNER JOIN
Orion.Nodes ON T1.NetworkNode = Nodes.NodeID