This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Display nodes in maintenance mode in a modern dashboard widget

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.

    SELECT
    n.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 n
    where
    unmanaged = '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
    ,CASE
    WHEN ([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
    ,CASE
    WHEN [N].UnManaged = 'TRUE' THEN ToLocal(N.UnManageFrom)
    ELSE NULL
    END As Unmanage_Start
    ,CASE
    WHEN [N].UnManaged = 'TRUE' THEN ToLocal(N.UnManageUntil)
    ELSE Null
    END As Unmanage_End
    FROM Orion.Nodes [N]
    LEFT OUTER JOIN Orion.VIM.VirtualMachines [V] on [N].NodeID = [V].NodeID
    LEFT OUTER JOIN Orion.AlertSuppression [M] on [N].Uri = [M].EntityUri
    WHERE ([N].UnManaged = 'TRUE'
    OR [M].SuppressFrom IS NOT Null)
    ORDER BY Unmanage_Start, Mute_Start DESC