RESOURCE SEARCH
The Infrastructure Resources page is used to search for resources.
Every resource has a set of attributes, such as ipAddress, hostName, agentInstalled, which are used to filter the list of resources.
Search for resources using the following syntax:
- Resource attribute + operator + value
The search feature has the Basic query builder and the Advanced query builder options.
The basic query builder supports all the major attributes with the ability to combine and filter expressions together. For nested queries, use the Advanced Query mode.
To navigate to the Infrastructure Resources page:
Log in to OpsRamp.
Go to Infrastructure > Resources.
The Infrastructure Resources page is displayed.
To start querying using the basic query builder:
Click + QUERY from the NEW VIEW tab. Select the attribute and the operator from the dynamically populated matching operator list.
Type in (or select) a value from the VALUES drop-down. The values are populated based on the selected attribute and operator.
The query result is displayed.Click + to add another expression.
The AND logical operator is selected by default. Click and select the desired operator.
Follow the steps mentioned above to form another expression – attribute, operator and value. The query result is displayed.
For more examples, click here.
For Power Users:
As a power user, you can go ahead and use the Advanced Query mode.
Click </> to switch to the Advanced query mode.
As soon as you start typing the attribute name in the Search box, the available attributes are displayed automatically.
Select the attribute and the operator from the dynamically populated matching operator list and then type in (or select) a value.
Select the logical operators,
AND
orOR
Follow the steps mentioned above – select the attribute, operator, and value, to add another expression. You can add as many valid expressions as possible.
Click the Search icon or press Enter. The query result is displayed.
Note:
- Your most recent query is added to the Recent Queries list, which shows the query string used for the search.
- To repeat a previous query, click the (magnifying glass) search icon to create a new tab, and then click the tile for that search string. The search results are displayed.
agentInstalled = "true" AND (ipAddress = "1.2.3.4" OR name CONTAINS "fedora") | Returns all agent installed resources with name containing "fedora" and resource with ipaddress as "1.2.3.4" |
availabilityState = "DOWN" AND (make = "VMware, Inc." OR os = "Ubuntu 14.04.6 LTS") | All resources whose availability state is DOWN and make is "VMware, Inc." and also OS is Ubuntu 14.04.6 LTS |
state = "active" AND os IN ("CentOS Linux release 7.6.1810 (Core)","Microsoft Windows Server 2019","freebsd 12.1-release") OR make = "VMware, Inc." AND agentInstalled = "true" | Returns all the agent installed resources with state as "active" and os is "CentOS Linux release 7.6.1810 (Core)", "Microsoft Windows Server 2019", "freebsd 12.1-release" and make is "VMware, Inc." |
For more information on how to use OpsQL, click here