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:

  1. Log in to OpsRamp.

  2. Go to Infrastructure > Resources.

Infrastructure Resource navigation

The Infrastructure Resources page is displayed.

Infrastructure Resource page

To start querying using the basic query builder:

  1. Click + QUERY from the NEW VIEW tab. Select the attribute and the operator from the dynamically populated matching operator list.

    Resource Operator List

  2. Type in (or select) a value from the VALUES drop-down. The values are populated based on the selected attribute and operator.

    Query values

    The query result is displayed.
    Query result

  3. Click + to add another expression.

  4. The AND logical operator is selected by default. Click and select the desired operator.

    Add another expression

  5. 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.

  1. Click </> to switch to the Advanced query mode.

  2. As soon as you start typing the attribute name in the Search box, the available attributes are displayed automatically.

    Advanced query - Attributes

  3. Select the attribute and the operator from the dynamically populated matching operator list and then type in (or select) a value.

    Resource Attribute Value

  4. Select the logical operators, AND or OR

    Select the logical operator

  5. Follow the steps mentioned above – select the attribute, operator, and value, to add another expression. You can add as many valid expressions as possible.

  6. 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.
Examples

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