Hi guys,
I'm pretty new to Thwack. I'm looking at getting a report for Node downtime over a 3 month period (and then schedule this to run every 3 months)
I've had a look on Thwack and found from another thread Node Downtime Reports
So, I'm looking at editing the below (extrapolated from above link) so that I can run the report for the last 3 months. If I know roughly how, I should be able to edit it.
So this is what I have and it shows a decent report for the last month (sorry if the formatting is a bit crummy). I'm not a SQL guy, so my apologies in advance for needing the spoonfeeding!
SELECT * FROM (
SELECT
Nodes.StatusLED,
Nodes.Caption,
Nodes.NodeID,
StartTime.Message,
StartTime.EventTime AS DownEventTime,
(
SELECT TOP 1 EventTime
FROM Events AS EndTimeTable
where EndTimeTable.EventTime >= StartTime.EventTime
AND EndTimeTable.EventType = 5
AND EndTimeTable.NetObjectType = 'N'
AND EndTimeTable.NetworkNode = StartTime.NetworkNode
AND EventTime IS NOT NULL
ORDER BY EndTimeTable.EventTime
) AS UpEventTime,
DATEDIFF(Mi, StartTime.EventTime,(
SELECT TOP 1 EventTime FROM Events AS Endtime
where EndTime.EventTime > StartTime.EventTime AND EndTime.EventType = 5 AND EndTime.NetObjectType = 'N'
AND EndTime.NetworkNode = StartTime.NetworkNode ORDER BY EndTime.EventTime)
) AS OutageDurationInMinutes
FROM Events StartTime
INNER JOIN Nodes ON StartTime.NetworkNode = Nodes.NodeID
WHERE (StartTime.EventType = 1)
) AS UpTimeTable
where outageDurationInMinutes IS NOT NULL