cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 11

Custom Table to show how long a node has been down for

Jump to solution

Hi All,

I created this a couple years back on an older version on solarwinds. I have moved it to a new environment on latest version of solarwinds. The StatusLED is showing as Down.gif not the Icon LED. What am I missing? Also the link on the node is not work either (take you details page of node). Any help greatly appreciated.

select distinct NodeID, Caption AS NodeName, StatusLED, Criticality, Support_Group,  'http://solarwinds..com/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N:'+CAST(n.NodeID as varchar(256)) as 'DetailsURL',

       convert(varchar(10), ( DATEDIFF(SECOND,MaxTriggeredDate,GETUTCDATE())/86400)) + 'd ' +

       convert(varchar(10), (( DATEDIFF(SECOND,MaxTriggeredDate,GETUTCDATE()+1)%86400)/3600)) + 'h '+

       convert(varchar(10), ((( DATEDIFF(SECOND,MaxTriggeredDate,GETUTCDATE()+1)%86400)%3600)/60)) + 'm ' as 'Active_time'

from [dbo].[Nodes] n

left join (select RelatedNodeId, MaxTriggeredDate=max(LastTriggeredDateTime) from AlertObjects

                     --where AlertID in ('43','49','109','92','410','269','223','271')

                     group by RelatedNodeId) ao on n.NodeID=ao.RelatedNodeId

where STATUS= '2'

    

or STATUS='2'

       and comments is null

order by Criticality ASC

pastedImage_2.png

Labels (2)
1 Solution

Your original SQL is probably good, has a couple custom fields I don't have so I had to modify it a bit.   You need your icon set up like this, with "/Orion/images/StatusIcons/{0} " in the box below "Generic Icon".

pastedImage_0.png

View solution in original post

15 Replies
Level 12

thanks very useful.

0 Kudos

On the page where you select such columns to display on the table did you hit the drop down for the "details page link" and status icon?  I feel like that would clear it up.  No changes to the query itself should be needed, but over the last few years the general direction has been to move away from custom sql tables in favor of custom SWQL queries like mentioned in the other replies because it is a bit easier to make them look good and they waste less screen real estate.

- Marc Netterfield, Github

I tried the details link and status icon in the drop down your referencing. Unfortunately i think because this is a SQL statement and not a SWQL statement those drop downs don't apply

0 Kudos

Shouldn't make a difference on a custom table widget, I'll fire this up in my lab and post a screen shot of whatever it takes to get it set back up.

- Marc Netterfield, Github
0 Kudos

Ok i could have sworn i tried the link details option before. But i tried it again and it works. I the LED still doesn't work.

pastedImage_0.png

Yeah I ran into the same when I tried it, the detailsurl works fine for the details but not the LED.  I'm sure there's some specific syntax it is looking for to let it know it can display that status with the status icon watermark but I couldn't find it.  You can force the issue by fully writing out the whole html tag and wrapping your nodename with it, something like concat('<img src="\orion\pathtoicons\',n.statusled','>',n.caption,'</a>') as NodeName

But I don't usually use the custom table resource for my custom queries so I can't give more specifics than that off the top of my head.

- Marc Netterfield, Github
0 Kudos

Could you put this into my code. I am not understanding where i should place it.

0 Kudos

Your original SQL is probably good, has a couple custom fields I don't have so I had to modify it a bit.   You need your icon set up like this, with "/Orion/images/StatusIcons/{0} " in the box below "Generic Icon".

pastedImage_0.png

View solution in original post

Thank you Graig Norborg. That did it.

pastedImage_0.png

You might also consider using the information in this resource to show which nodes are down, when they went down, when they came back up, and how long they were down.  I implemented it this morning in a minute and quite suddenly had some great new actionable information to work with.

Node Downtime with Duration and Minimum Length Filtering

0 Kudos

You need to use the "_IconFor" method I think. 

In this case I think you want to do this:

select distinct NodeID, Caption AS NodeName, StatusLED AS [_IconFor_NodeName], Criticality...

Although you might need to put "Caption" instead of "NodeName", but I think this is right...

Here is another article that explains it a bit...

How to insert the status icon for interfaces into SWQL resource

0 Kudos

This do not work. I get an error

pastedImage_0.png

Oh, you didn't say you were in a Report Writer, from the SWQL you posted I was assuming you were just adding it as a "Custom Query" resource to a page. 

A good way to help you figure out stuff like this is to go look at other reports.  In this case I'd recommend something like the "Web-based" version of the "Current Status of Each Node" report.   If you go in there, you'll see the "STATUS LED" is set up similar to yours, but instead of /path/{0}.gif, they have /Orion/images/StatusIcons/{0} (with no .gif afterwards).

HTH!

0 Kudos

This is in a Custom Table widget using SQL option. Not SWQL.

0 Kudos

Following.

0 Kudos