List All Resources in Widget

I am going through all monitored notes, listing resources, and selecting the options available.  Now I would like to have a widget in a dashboard that quickly shows all resources for a given node and the alert status of each resource.  Is this possible?  I can't find anything in the available WSQL options that references resources.

  • I would recommend you check out these two docs and have a good understanding of them, and then you'll have an idea of how this is possible and how to make it look good. 

    Navigation Properties - SolarWinds Platform API - The SolarWinds Platform - THWACK

    Enhancing Custom Query Widgets - SolarWinds Platform API - The SolarWinds Platform - THWACK

    This query may work in a Custom SWQL Query Summary resource (a resource on a summary page, not Details page) that has search enabled. I don't have access to a sw environment to test it out, but it should get you on the right track. The LinkFor may not work, i've never done those before so not sure how it behave.

    <#
    SWQL Query to search for a node and see all the resources attached to it.
    Node Details
    Volume Details
    Interface Details
    Application Details

    Used in a custom SQWL resource with the search function to get this info for any node LIKE Search String.
    #>

    #Use a custom widget to display all the resources on a node.
    #start selecting Nodes information
    Select [n].status
    , CONCAT('/Orion/images/StatusIcons/Small-', [n].StatusLED) AS [_IconFor_status]
    , [n].DisplayName
    , [n].IP_Address
    , [n].Vendor
    #polling method
    , [n].ObjectSubType
    , [n].DetailsUrl AS [_LinkFor_DisplayName]

    #Collect Volume Information
    , [n].Volumes.Status AS [Volume Status]
    , [n].Volumes.Caption
    , [n].Volumes.DetailsUrl AS [_LinkFor_Caption]
    , [n].Volumes.VolumePercentUsed AS [Percent Used]

    #Collect Interface information
    , [n].Interfaces.Status AS [Interface Status]
    , [n].Interfaces.InterfaceName AS [InterfaceName]
    , [n].Interfaces.DetailsUrl AS [_LinkFor_InterfaceName]

    #Collect Application information
    , [n].Application.Status AS [Application Status]
    , [n].Application.Name AS [Name]
    , [n].Application.DetailsUrl AS [_LinkFor_Name]

    #Gets search result from orion.nodes table.
    FROM Orion.nodes AS [n]
    WHERE [n].DisplayName LIKE '%${Search_String}%'

    Good luck! 

  • Option 2.

    I didn't write this, someone else did and posted it on Thwack.  But this is the one I use in our enviroment.

    1.  Create a new custom table widget.
    2.  Unselect the 'Use current network object as a Data Source radio button.
    3. Click Edit Source button.
    4. Change the selection method to Advanced Database Query.
    5. Select SWQL and then post this SWQL query.

    SELECT
    n.Caption
    ,n.IPAddress
    ,n.MachineType
    ,CASE
    WHEN cpu.PollerType IS NOT NULL THEN 'Assigned'
    ELSE 'Not Assigned'
    END AS [Agent CPU Poller]

    ,CASE
    WHEN asset.PollerType IS NOT NULL THEN 'Assigned'
    ELSE 'Not Assigned'
    END AS [Asset Poller]

    ,CASE
    WHEN icmp.Enabled = 'True' then 'Assigned'
    ELSE 'Not Assigned'
    END AS [ICMP Poller]
    ,CASE
    WHEN n.SCMNode.Enabled IS NOT NULL THEN 'Assigned'
    ELSE 'Not Assigned'
    END AS [SCM Poller]
    ,CASE
    WHEN n.Volumes.Type IS NOT NULL THEN 'Assigned'
    ELSE 'Not Assigned'
    END AS [Volumes Poller]
    --,n.NodeID
    --,n.Uri
    FROM Orion.Nodes n

    LEFT JOIN (SELECT PollerID, PollerType, NetObjectID, Enabled FROM Orion.Pollers WHERE PollerType LIKE '%CPU%') cpu ON cpu.NetObjectID = n.NodeID
    LEFT JOIN (SELECT PollerID, PollerType, NetObjectID, Enabled FROM Orion.Pollers WHERE PollerType LIKE '%asset%') asset ON asset.NetObjectID = n.NodeID
    LEFT JOIN (SELECT PollerID, PollerType, NetObjectID, Enabled FROM Orion.Pollers WHERE PollerType LIKE '%ICMP%' ) icmp ON icmp.NetObjectID = n.NodeID

    WHERE 1=1
    AND NodeID=${nodeid} AND n.ObjectSubType IN ('agent')

    Select and edit the columns as desired and then submit.

    This is the widget you'll get.

    Word to the wise. If you go down this road make sure this widget is used on a 'view by device type' and not on your generic device view. You wouldn't want this widget on a network device but maybe you do with a few minor tweaks. 

  • Thanks Bourlis.  Unfortunately, this is not what I'm looking for.  What I would like to have is a table with a list of all servers, perhaps sorted by site but maybe not.  If I click on a site, it gives me a table with the server name and ALL monitored resources and their status.  Something like:

    Server1
    Physical Memory - Green
    Virtual Memory - Yellow
    C: - Yellow
    D: - Red
    IIS - Yellow
    Active Directory - Green

    This would allow me to instantly see what component on a server I should dig into first.  Does this make sense?

    Thanks,

    Joe

  • Jere557, thanks.  The links to the docs were very helpful.  Using SWQL Studio I was able to follow along, and I found some Node and Resource tables and verbs.  Unfortunately this is a bit above my programming level.  Not sure I'll be able to take this further without help from others.

    (Your code did not work, errored out on an expected SELECT statement.)

  • Here is one I use.  It's really old but still seems to be working.  It does not include SAM monitors or API pollers (API pollers didn't even exist when I wrote this)

    Select Monitor, _IconFor_Monitor, _LinkFor_Monitor, Current, Warning, _LinkFor_Warning, Critical, _LinkFor_Critical from (
    Select
    'CPU' as Monitor,
    CASE
    WHEN t.IsLevel1State = False THEN '/Orion/images/StatusIcons/Small-Up.gif'
    WHEN t.IsLevel1State = True and IsLevel2State = False THEN '/Orion/images/StatusIcons/Small-Warning.gif'
    WHEN t.IsLevel2State = True THEN '/Orion/images/StatusIcons/Small-Down.gif'
    END as [_IconFor_Monitor],
    'orion.dtc.corp/.../NodeDetails.aspx as [_LinkFor_Monitor],
    t.CurrentValue as Current,
    t.Level1Value as Warning,
    'orion.dtc.corp/.../NodeProperties.aspx as [_LinkFor_Warning],
    t.Level2Value as Critical,
    'orion.dtc.corp/.../NodeProperties.aspx as [_LinkFor_Critical]
    from Orion.Nodes n
    inner join Orion.NodesThresholds t on t.InstanceId = n.NodeID
    WHERE
    t.name='Nodes.Stats.CpuLoad' AND
    t.instanceId = 3861 AND
    not n.ObjectSubType = 'ICMP' AND
    t.CurrentValue > -1
    UNION (
    Select
    'Memory' as Monitor,
    CASE
    WHEN t.IsLevel1State = False THEN '/Orion/images/StatusIcons/Small-Up.gif'
    WHEN t.IsLevel1State = True and IsLevel2State = False THEN '/Orion/images/StatusIcons/Small-Warning.gif'
    WHEN t.IsLevel2State = True THEN '/Orion/images/StatusIcons/Small-Down.gif'
    END as [_IconFor_Monitor],
    'orion.dtc.corp/.../NodeDetails.aspx as [_LinkFor_Monitor],
    n.PercentMemoryUsed as Current,
    t.Level1Value as Warning,
    'orion.dtc.corp/.../NodeProperties.aspx as [_LinkFor_Warning],
    t.Level2Value as Critical,
    'orion.dtc.corp/.../NodeProperties.aspx as [_LinkFor_Critical]
    from Orion.Nodes n
    inner join Orion.NodesThresholds t on t.InstanceId = n.NodeID
    WHERE
    t.name='Nodes.Stats.PercentMemoryUsed' AND
    t.instanceId = 3861 AND
    not n.ObjectSubType = 'ICMP' AND
    t.CurrentValue > -1
    )
    Union (
    -- Disk Monitors
    SELECT
    v.Caption as Monitor,
    CASE
    WHEN v.VolumePercentUsed is null THEN '/Orion/images/StatusIcons/Small-Unknown.gif'
    WHEN v.PercentDiskUsedThreshold.IsLevel2State = True THEN '/Orion/images/StatusIcons/Small-Down.gif'
    WHEN v.PercentDiskUsedThreshold.IsLevel1State = True THEN '/Orion/images/StatusIcons/Small-Warning.gif'
    ELSE '/Orion/images/StatusIcons/Small-Up.gif'
    END as [_IconFor_Monitor],
    v.DetailsURL as [_LinkFor_Monitor],
    Round(v.VolumePercentUsed,0) as Current,
    v.PercentDiskUsedThreshold.Level1Value as Warning,
    'orion.dtc.corp/.../NodeProperties.aspx as [_LinkFor_Warning],
    v.PercentDiskUsedThreshold.Level2Value as Critical,
    'orion.dtc.corp/.../NodeProperties.aspx as [_LinkFor_Critical]
    From Orion.Volumes v
    Where NodeID = 3861
    and v.Type in ( 'Fixed Disk', 'Mount Point', 'FixedDisk', 'MountPoint' )
    ))

  • GAH!!!!   Why can I not post SWQL as a "code" insert so that the formatting looks better.

  • You can! There is a code option under insert when posting. You should be able to edit your post and update it.

  • Give it a try.  try to post that nasty swql I posted, but post it as a code insert. 

  • select nodeid from orion.nodes

    Ok, I can do really simple ones... but I don't ever post those.... Slight smile

  • Thanks brscott.  I tried putting this code into a modern dashboard using a table widget, but the validation fails.  It doesn't like 'orion' in the select clause.  I replaced your URL with mine but no change.  Any thoughts on this?
    Thanks,
    Joe