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.

Can't get status icons to show in custom query

This one has me perplexed...

Using NPM 12.0.1

I created a custom query to show me the down nodes and broke out the downtime to show Days, Hours and Minutes but I can't get the bloody status icon to show. It simply disappears from the resource. I tested to make sure that I can actually see the icon by cutting and pasting from the code into my browser and I see it, just not in the resource.

Here is my code:

SELECT

'/Orion/images/StatusIcons/Small-' + Nodes.StatusIcon AS [_IconFor_NodeName]

,Nodes.Caption, Nodes.IP_Address,

MAX(E.EventTime) AS DownTime,

Concat(DayDiff(MAX(E.EventTime),getdate())) + ' Day(s), ' +  concat((MinuteDiff(MAX(E.EventTime),getdate()) - (DayDiff(MAX(E.EventTime),getdate()) * 1440))/60) + ' Hour(s), ' + substring(tostring(round((((MinuteDiff(MAX(E.EventTime),getdate()) - (DayDiff(MAX(E.EventTime),getdate()) * 1440))/60.0 -(MinuteDiff(MAX(E.EventTime),getdate()) - (DayDiff(MAX(E.EventTime),getdate()) * 1440))/60)*60),0)),1,2) + ' Min(s)'

as Duration

FROM Orion.Nodes as Nodes

INNER JOIN Orion.Events E ON E.NetworkNode = Nodes.NodeID

WHERE (Nodes.status = 2)

GROUP BY Nodes.Caption, Nodes.NodeID, Nodes.IP_Address, Nodes.Status, nodes.GroupStatus

ORDER BY Nodes.Caption

Here is the output in Custom Query:

Capture.png

Here is the output from SDK:

Capture2.PNG

  • Hello sotherls​,

    Here is one way of doing it - just insert a blank column using : '' as n

    (you can name this whatever you want, I used n to keep it short), then use point the icon to that column:

    '/Orion/images/StatusIcons/Small-' + tostring(Nodes.StatusIcon)  AS [_IconFor_n]

    Here is with that added to what you already had:

    SELECT

    '' as n,

    '/Orion/images/StatusIcons/Small-' + tostring(Nodes.StatusIcon)  AS [_IconFor_n]

    ,Nodes.Caption,

    Nodes.IP_Address,

    MAX(E.EventTime) AS DownTime,

    Concat(DayDiff(MAX(E.EventTime),getdate())) + ' Day(s), ' +  concat((MinuteDiff(MAX(E.EventTime),getdate()) - (DayDiff(MAX(E.EventTime),getdate()) * 1440))/60) + ' Hour(s), ' + substring(tostring(round((((MinuteDiff(MAX(E.EventTime),getdate()) - (DayDiff(MAX(E.EventTime),getdate()) * 1440))/60.0 -(MinuteDiff(MAX(E.EventTime),getdate()) - (DayDiff(MAX(E.EventTime),getdate()) * 1440))/60)*60),0)),1,2) + ' Min(s)'

    as Duration

    FROM Orion.Nodes as Nodes

    INNER JOIN Orion.Events E ON E.NetworkNode = Nodes.NodeID

    WHERE (Nodes.status = 2)

    GROUP BY Nodes.Caption, Nodes.NodeID, Nodes.IP_Address, Nodes.Status, nodes.GroupStatus

    ORDER BY Nodes.Caption

    Hope this helps,

    =swql