Select Page

Using Custom Query To Search For All IP Addresses Assigned To A Node

by 29, Mar, 2019Blog Posts, Network Management, Useful Information

The other day a customer had asked me if there was a way to search for ALL IP addresses on a node or search for any IP address and have Orion show us the related device. Well this is possible using a specific widget in the Orion web interface!

To create a searchable query for this we’ll want to start by adding a Custom Query widget to our Home Summary page (or any other page should you prefer).

  1. On the left, mouse over the pencil and then click Customize Page
  2. Click Add Widgets
  3. Search for Custom Query and drag the custom query into the view

Don’t you just love the new way of building web pages in Orion?? As with all widgets and layout design for Orion pages place it somewhere that is relevant for the importance i.e. at the top if you are going to use regularly or on a sub tab or lower down the page if not. You should now see a new widget on the screen, go ahead and click edit.

Give the Custom Query a name, something like ‘Search all IP addresses on nodes’.

Copy and paste the following into the Custom SWQL Query block:
[code]SELECT n.Caption AS [Node Name], i.Caption AS [Interface Name], ip.IPAddress AS [IP Address]
FROM Orion.Nodes n
INNER JOIN Orion.NPM.Interfaces i ON n.NodeID = i.NodeID
INNER JOIN Orion.NodeIPAddresses ip ON i.InterfaceIndex = ip.InterfaceIndex AND n.NodeID = ip.NodeID
WHERE ip.IPAddress IN (SELECT ip.IPAddress FROM Orion.NPM.Interfaces i INNER JOIN Orion.NodeIPAddresses ON ip.NodeID AND ip.Interfaceindex = i.interfaceindex)[/code]

The great and I mean GREAT thing about this Custom Query resource, is the ability to include a search function, which we can use to map into filter clauses in the SWQL. To enable search for the query tick ‘Enable Search’ and copy and paste the following into the text block. Note the only change is in the last 3 lines, which will take the value from the text field to use in the filter:
[code]SELECT n.Caption AS [Node Name], i.Caption AS [Interface Name], ip.IPAddress AS [IP Address]
FROM Orion.Nodes n
INNER JOIN Orion.NPM.Interfaces i ON n.NodeID = i.NodeID
INNER JOIN Orion.NodeIPAddresses ip ON i.InterfaceIndex = ip.InterfaceIndex AND n.NodeID = ip.NodeID
WHERE ip.IPAddress LIKE ‘%${SEARCH_STRING}%’ OR N.CAPTION LIKE ‘%${SEARCH_STRING}%’ OR i.Caption LIKE ‘%${SEARCH_STRING}%'[/code]

Click Submit. You should now have a searchable widget that will allow you to search for Node Name, Interface Name or IP Address!

IP Addresses on Nodes (Insight Images) - Prosperon Networks

Training Course: SolarWinds Training Courses

Dax Attwood

Dax Attwood

Account Manager

As an Account manager at Prosperon Networks, Dax spends his time helping customers to optimise their IT Management capabilities, as well as keeping them up-to-date with the latest technologies and products.

Training Course: SolarWinds Training Courses

Related Insights From The Prosperon Blog

Share This