Using Custom Query To Search For All IP Addresses Assigned To A Node
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).
- On the left, mouse over the pencil and then click Customize Page
- Click Add Widgets
- 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!
Training Course: SolarWinds Training Courses
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
The Critical Role Of The Trusted Advisor In NetOps
Before there was “Network Operations” there were networks. Networks grew out of a need for connecting one box to another, sharing printers, and for more advanced users,...
Webinar On-Demand: Beyond Monitoring – Introducing SolarWinds Observability Platform
In this webinar, you will discover how SolarWinds® is evolving to deliver complete infrastructure visibility. This webinar examines how to extend visibility across your IT...
An Introduction To SolarWinds Orion’s Device Configuration Compliance Reporting
Needless to say, it is critical that the all network devices in your organisation are secure and available at all times. However, configuration changes and adding new...