All, I am looking for some SWQL/SQL code that can pull out the following information from the database.
- Device Name
- IP Address
- Time Down
- Time Up
- Minutes Node was down
You can use this query as an SWQL report or as a Query Widget. It is excellent as a widget as it includes hyperlinks. Credit to the original creator for adding all the comments!
select n.caption as [Device…
OK... the start of this query was online somewhere...i have made it my own... OF COURSE>>>>> IF YOU USE THIS IN A LIVE ENVIRONMENT, it is not supported by SolarWinds! USE AT YOUR OWN RISK…
Just be forewarned that the "Events" table (one of the sources of this query) typically does not have the same historical settings as the Response Time details tables.
OK... the start of this query was online somewhere...i have made it my own... OF COURSE>>>>> IF YOU USE THIS IN A LIVE ENVIRONMENT, it is not supported by SolarWinds! USE AT YOUR OWN RISK...
Now, after saying that... you will most definately have to modify this for your environment..as i am using some pulling down some custom properties that are only on our environment...
SELECT * FROM ( SELECT --Nodes.StatusLED, Nodes.Caption, Nodes.NodeID, Nodes.Is_Production, 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) AND Nodes.Is_Production = '1' AND Nodes.Model = 'Server' ) AS UpTimeTable where outageDurationInMinutes IS NOT NULL ORDER BY Caption ASC, DownEventTime ASC
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 190,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.