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

Custom Query resource with colors and styles

Many of you may be aware of the beauty of the Custom Query resource when it comes to customisation of the Web Presentation. Simply when a resource/widget is not available out of the box, the Custom Query can do the trick, given that the data to be displayed are in a tabular format.

Within the resource, there are hidden gems to beautify the output, also known as the _IconFor_ and _LinkFor_ columns. (See this blog post if you are not familiar with this technique: SolarWinds Orion Custom Query Resource - A Hidden Gem! | Prosperon Networks )

So, a regular Custom Query resource would look like this:

pastedImage_3.png

Today we're going to take it one step further and make it look like this...:

pastedImage_4.png

Another example usage on Citrix Netscaler vserver UnDPs:

( Quoting wluther​ for the following content as I really enjoy his documents in this part!)

This mod has been tested against the following SolarWinds environment: (It may, or may not work on other versions)

Orion Platform 2018.4 HF2

Orion Platform 2019.2

Orion Platform 2019.2 HF2

Orion Platform 2019.4

Orion Platform 2019.4 HF1

Orion Platform 2019.4 HF2

Orion Platform 2019.4 HF3

WHAT DO YOU NEED?

  1. Access to manage views in your Orion environment
  2. Access to your Orion main polling engine (AND any other additional web servers you may have)
  3. HTML skills (not included in this tutorial)

Before we begin,

PLEASE don't edit the system files/database without backing them up first.

If you see a friend or co-worker making changes without backing up first, please alert the authorities.

Friends don't let friends mod without backups.

STEPS:

1. Download the attached file

2. Make a copy of  \inetpub\SolarWinds\Orion\NetPerfMon\Resources\Misc\CustomQuery.js AND KEEP IT IN YOUR SAFE

3. Copy the attached file (CustomQuery.js) in this document to the above location.

    3a. Repeat as necessary for other Web Servers in your environment 

4. Ready.

How To Use:

Assuming you are familiar with the _IconFor_ and the _LinkFor_ columns, you can now use the _StyleFor_ to apply styling to individual cells.

The above screenshot is based on the following SWQL code, which is reporting the current response time for all nodes with the following conventions:

1. When the response time is less than 0 (node offline) or more than 100ms, then apply the color:red;font-weight:bold;font-size:16px style

2. When the response time is more than 20 ms, apply the following style: color:gold;font-weight:bold

3. If none of the above, just let the style be.

SELECT N.Caption AS [Node Name]
,'/Orion/images/StatusIcons/small-' + ToString(N.StatusIcon) AS [_IconFor_Node Name]
,'/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N%3a' + ToString(N.NodeID) AS [_LinkFor_Node Name]
,N.ResponseTime
,CASE
WHEN N.ResponseTime < 0 OR N.ResponseTime > 100 THEN 'color:red;font-weight:bold;font-size:16px'
WHEN N.ResponseTime > 20 THEN 'color:gold;font-weight:bold'
ELSE ''
END AS [_StyleFor_ResponseTime]
FROM Orion.Nodes AS N

I'm sure anyone more familiar with HTML than I am will come up with better visual results, so give it a go and let me know how it goes

Regards,

Antonis

Labels (2)
Attachments
Comments

Everything I would expect of you - great work and thanks for sharing

Awesome - Thank you for sharing.

Super cool stuff, antonis.athanasiou​! Now we need to add some progress bars and time converter thingies too.


Anything in the works to add more default options like this one, tdanner​?

antonis.athanasiou

Also, don't forget to tag CourtesyIT​ when you are posting new ways to customize the Orion environments so he can add it to "The List"... How to do various customizations with your Solarwinds

That list is a great place for the Thwack community to reference when looking to improve their site(s).

Good point! CourtesyIT​, just in case you missed the first mention

I like it.  I will have to play around with it a bit. 

Thanks,

Just a comment, I had to cycle IIS to get this to take effect - not sure if that is normal, other than that this is just what I was looking for! Great work!!

Glad you like it!

All is changed is the JavaScript, it may have got cached in some way I guess.

Cheers Antonis ill be stealing this

Version history
Revision #:
1 of 1
Last update:
‎03-13-2019 01:40 PM
Updated by: