Print Download PDF Send Feedback

Previous

Next

cpmiquerybin

Description

The cpmiquerybin connects to a specified database, runs a user-defined query and shows the query results. The results can be a collection of Firewall 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.

Note - 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 – display FW-1 sets containing data of each retrieved object.

<database>

Name of the database file in quotes. For example, "mdsdb". Use "" 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 the null ("") query to return all objects in the database table.

You can use wildcard character (*) as a 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__

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

Return Values

0 - Query returns data successfully
1 - Query does not return data or there is a query syntax error

Example

# cpmiquerybin attr "" network_objects "" -a __name__

DMZZone

WirelessZone

ExternalZone

InternalZone

AuxiliaryNet

LocalMachine_All_Interfaces

CPDShield

InternalNet

LocalMachine

DMZNet

This example shows the names of the currently defined network objects.