Is it possible to display a list of nodes in maintenance mode in a modern dashboard table widget?
If possible what is the SWQL to get that data ?
Yes this is possible, the SWQL you need for a table widget would look something like this.
SELECTn.caption,n.DetailsUrl,n.Status,unmanaged, tolocal(UnManageFrom) as Unmanage, daydiff(getutcdate(), UnManagefrom)as [Days till Unmanage],tolocal(UnManageUntil) as Remanage,daydiff(getutcdate(), UnManageuntil)as [Days until Remanage]FROM Orion.Nodes nwhereunmanaged = 'true'
We have a different spin on our side. We also wanted to include if the VM was muted. I also include information on the VM guest state as well.
SELECT [N].Caption,[N].DetailsUrl,[N].Status As NodeStatus,[N].StatusIcon,ToLocal([M].SuppressFrom) As Mute_Start,ToLocal([M].SuppressUntil) As Mute_End,[V].GuestState,CASEWHEN ([N].UnManaged = 'TRUE' AND [M].SuppressFrom IS Not Null) THEN 'Muted,Unmanaged'WHEN ([N].UnManaged = 'TRUE' AND [M].SuppressFrom IS Null) THEN 'Unmanaged'WHEN ([N].UnManaged = 'FALSE' AND [M].SuppressFrom IS Not Null) THEN 'Muted'ELSE 'UNKNOWN'END AS Status,CASEWHEN [N].UnManaged = 'TRUE' THEN ToLocal(N.UnManageFrom)ELSE NULLEND As Unmanage_Start,CASEWHEN [N].UnManaged = 'TRUE' THEN ToLocal(N.UnManageUntil)ELSE NullEND As Unmanage_EndFROM Orion.Nodes [N]LEFT OUTER JOIN Orion.VIM.VirtualMachines [V] on [N].NodeID = [V].NodeIDLEFT OUTER JOIN Orion.AlertSuppression [M] on [N].Uri = [M].EntityUriWHERE ([N].UnManaged = 'TRUE'OR [M].SuppressFrom IS NOT Null)ORDER BY Unmanage_Start, Mute_Start DESC