I'd like to convert SWIS cast/convert Orion.Nodes.SystemUptime to a days/hours/mins format in SWIS. Is this possible?
SWQL Guru @tdanner posted a reply in this: thwack.solarwinds.com/.../given-sysuptime-in-seconds-how-are-you-doing-date-math-to-display-days-hours-mins-secondsAlso try looking at LastBoot as it is in a DateTime format.
SELECTn.Caption,n.Lastboot,DayDiff(n.LastBoot, GetUtcDate()) as [Days_Since_LastBoot],n.SystemUptime AS [SystemUpTime_Seconds],ROUND( n.SystemUpTime / 86400, 0 ) AS [SystemUpTime_Days]FROM Orion.Nodes nORDER BY n.SystemUptime DESC
And if you haven't seen it: github.com/.../SWQL-Functions
I think I stole this method from someone else on thwack in the past, but this is typically how I perform Day/Hour/Minute for any custom SWQL widgets of mine:
SELECTn.Caption, n.LastBoot, CASEWHEN TOSTRING(FLOOR(HOURDIFF(n.LastBoot,GETUTCDATE())/24.0)) <> 0THEN CONCAT(TOSTRING(FLOOR(HOURDIFF(n.LastBoot,GETUTCDATE())/24.0)), 'd') ELSE ''END + ' '+ CASEWHEN TOSTRING(FLOOR(MINUTEDIFF(n.LastBoot,GETUTCDATE())/60.0 % 24)) <> 0THEN CONCAT(TOSTRING(FLOOR(MINUTEDIFF(n.LastBoot,GETUTCDATE())/60.0 % 24)), 'h') ELSE ''END + ' '+ CASEWHEN TOSTRING(FLOOR(MINUTEDIFF(n.LastBoot,GETUTCDATE())%60)) <> 0THEN CONCAT(TOSTRING(FLOOR(MINUTEDIFF(n.LastBoot,GETUTCDATE())%60)), 'm') ELSE ''END AS [Uptime]FROM Orion.Nodes nORDER BY n.SystemUpTime DESC
You can use this method for any table that has a DateTime formatted field. You would just replace "n.LastBoot" in each of the CASE statements with whatever the DateTime field would be.Since this converts the duration to a string, I would still use a DateTime field for your ORDER BY statement so you can preserve ascending/descending order for duration.
Cisco ASR Devices.pollerCisco ASR Devices
SWQL is built on the framework of SQL and as such supports most of the standard clauses as part of a query. A very simple example query is: SELECT Caption, IPAddress, Vendor, ResponseTime FROM Orion.Nodes Dissecting this query is relatively straightforward: show some fields (Caption, IP address, Vendor, and Response Time)…
Active SSL Tunnels-ASA.UnDPThis poller *should* display the number of Active SSL VPN (Anyconnect) Tunnels currently connected to your box. However, I tried it with my 5520 running 8.0.4 and for some reason I get a OID Not Supported. Here's my post in the forum: *EDIT* This is confirmed working with at least Interm release…
HP ProCurve Switches Hardening check.xmlGeneral hardening for HP switches