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

Resource to Search by Port Description

Hey All!

I had a request to create a widget on port description, and I whipped this up real quick.  Enjoy!

  1. On the dashboard, customize  the page and add a “Custom Query” widget
  2. Edit the widget, title this “Search Port Description”, and check the box for “Enable Search”
  3. Use the following queries:
    For the top box:

select UP.Node.Caption as [Node Name],

UP.Node.DetailsUrl as [_LinkFor_Node Name],

UP.name as [Interface Name],

UP.DetailsUrl as [_LinkFor_Interface Name],

UP.PortDescription as [Port Description],

UP.PortVLANs.DisplayName as [VLan]

from Orion.UDT.Port as UP
For the bottom Box:
select UP.Node.Caption as [Node Name],

UP.Node.DetailsUrl as [_LinkFor_Node Name],

UP.name as [Interface Name],

UP.DetailsUrl as [_LinkFor_Interface Name],

UP.PortDescription as [Port Description],

UP.PortVLANs.DisplayName as [VLan]

from Orion.UDT.Port as UP
  WHERE UP.PortDescription like '%${SEARCH_STRING}%'

4. Change the number of rows per page to a larger number, up to 100 (I used 10)

2017-12-18_0851.png

  5. Submit, and you now have a resource for searching!


Let me know if you have any questions!

Attachments
Comments

Hi.. Many thanks for the query.. This runs fine for most cases; however I see on some queries, it returns multiple entries of the same data

Port-Description-Thwack-192885 - Randomised.JPG

This can potentially happen for a couple of reasons:

1) "unique" is not set

2) not shown in the query is that the query is returning all of the devices connected to that port.  Even though that is not shown, it would still return a value for each one of the instances of a device connected to it.

Hi Animelov..Thankyou for your response; however I am new to this SWQL world.. so could you please let me know where do i set the "unique" in the query ?

Thanks

Add the word "distinct" to the select query, so you have...

select distinct UP.Node.Caption as [Node Name],

This is an excellent resource. Is there a way to show MAC addresses in place of Vlans?

Yessir,

Just replace the VLan with (in both top and bottom queries):

UP.MACAddress as [MAC Address]

And you should be good to go

They VLAN number does not show in my widget.  Any ideas?

Hey, sorry for the delay, been out for alot of personal things.  Out of curiosity, are you seeing any VLan information when you drill down into a UDT port?  Namely, I'm wondering if you ARE seeing it within NPM, but NOT seeing it within UDT.

When I drill down, I do see the VLAN info but not on the widget.

Thanks,

Edison

Would it be possible to post a screenshot?

search-port-desc.pngport-details.png

SWQL-query.png

Can you search for 8301 instead of 8031 instead?  The three results you get are different from the drill down screenshot you posted.

port-desc.pngport-details.png

Well crap, the query has been wrong for almost a year.  The line on the VLan should be VLanID, not DisplayName.  Here are the corrected queries:

select UP.Node.Caption as [Node Name],

UP.Node.DetailsUrl as [_LinkFor_Node Name],

UP.name as [Interface Name],

UP.DetailsUrl as [_LinkFor_Interface Name],

UP.PortDescription as [Port Description],

UP.PortVLANs.VlanID as [VLan]

from Orion.UDT.Port as UP
For the bottom Box:
select UP.Node.Caption as [Node Name],

UP.Node.DetailsUrl as [_LinkFor_Node Name],

UP.name as [Interface Name],

UP.DetailsUrl as [_LinkFor_Interface Name],

UP.PortDescription as [Port Description],

UP.PortVLANs.VlanID as [VLan]

from Orion.UDT.Port as UP
  WHERE UP.PortDescription like '%${SEARCH_STRING}%'

That works. Thank you so much.

Edison

So - I just stumbled upon this post and it is exactly what I need. I've followed the scripts exactly as you have in the post, but the widget continues to error "There was an error processing the request".   Any thoughts on what would cause this?  I'm not a script writer in any way, shape or form....but I made sure there weren't any extra spaces, lines, etc.   Looking to be able to search on Interface Description just like the post is titled.

Would it be possible to post or IM me a screenshot of how you have it entered please?

Hi,

Here are a couple screen shots – let me know if you’d like to see more.

Version history
Revision #:
1 of 1
Last update:
‎12-18-2017 09:07 AM
Updated by: