cpmiquerybin

Description

The cpmiquerybin utility connects to a specified database, runs a user-defined query and shows the query results.

The results can be a collection of Security Gateway sets or a tab-delimited list of specified fields from each retrieved object.

The default database of the query tool is based on the shell environment settings.

To connect to a Domain Management Server database, run mdsenv and define the necessary environment variables.

Use the Domain Management Server name or IP address as the first parameter.

Notes:

  • You can see complete documentation of the cpmiquerybin utility, with the full query syntax, examples, and a list of common attributes in sk65181.

  • The MISSING_ATTR string shows when you use an attribute name that does not exist in the objects in query result.

Syntax

cpmiquerybin <query_result_type> <database> <table> <query> [-a <attributes_list>]

Parameters

Parameter

Description

<query_result_type>

Query result in one of these formats:

  • attr - Returns values from one or more specified fields for each object. Use the "-a" parameter followed by a comma separated list of fields.

  • object - Shows Security Gateway sets containing data of each retrieved object.

<database>

Name of the database file in quotes. For example, "mdsdb".

Use empty double quotes "" to run the query on the default database.

<table>

Name of the database table that contains the data.

<query>

One or more query strings in a comma separated list.

Use empty double quotes ("") to return all objects in the database table.

You can use the asterisk character (*) as a wildcard replacement for one or more matching characters in your query string.

-a <attributes_list>

If you use the "query_result_type" parameter, you must specify one or more attributes in a comma-delimited list (without spaces) of object fields.

You can return all object names with the special string: __name__

Return Values

  • 0 - Query returns data successfully

  • 1 - Query does not return data or there is a query syntax error

Example - Viewing the names of the currently defined network objects

[Expert@HostName:0]# cpmiquerybin attr "" network_objects "" -a __name__
DMZZone
WirelessZone
ExternalZone
InternalZone
AuxiliaryNet
LocalMachine_All_Interfaces
CPDShield
InternalNet
LocalMachine
DMZNet
[Expert@HostName:0]#