What would have to be done to make this report show outage minutes by MachineType in the nodes table?
Here is an example what I am looking to convert over from an excel spreadsheet
I have narrowed the code down to only see our switches, see below
SELECT MAX(VendorIcon) AS VendorIcon, MAX(Caption) AS Caption, NodeID, SUM(OutageDurationInMinutes) AS SumOutageDurationInMinutes, MAX(StatusLED) AS StatusLED, MAX(MachineType) AS MachineType
FROM (
SELECT
Nodes.StatusLED,
Nodes.VendorIcon,
Nodes.MachineType,
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 AND DownEventTime between dateadd(month, datediff(month, 0, getdate())-1, 0) and dateadd(month, datediff(month, 0, getdate()), 0) AND (Caption LIKE '%swt%' OR Caption LIKE '%stk%')
GROUP BY NodeID
ORDER BY Caption ASC
This is the report now
Thanks in advance