The basic syntax is:

dmctl [options...] [<command>]

When given a command or batch file to run, dmctl executes the commands and exits.

The options include those listed in dmctl options:

Table 1. dmctl options

Option

Description

--server=<name>

Name of Domain Manager. This argument is used to identify the Domain Manager to connect to. If it is not specified, it can be set later, in interactive mode, by using the attach command. If it is in a host:port/name format, the specified host:port is used to locate Domain Manager name. Otherwise, if it is in a simple name format, name is located by the Broker.

Also -s <name>.

--broker=<location>

Alternate Broker <host>:<port> location. If it is not specified, the Broker is located by the standard search order, as follows:

If the SM_BROKER environment variable is defined, use its value. Otherwise, use the default smarts-broker:426 location.

Either <host> or :<port> portions may be omitted, in which case the defaults smarts-broker and :426 are used, respectively.

Also -b <location>.

--file=<file>

Input batch file. Given this option, dmctl executes the commands in the file and exits.

Also -f <file>.

--timeout[=<seconds>]

Set a timeout on the remote execution of each command. A value of 0 specifies no limit. The default is 0 (no limit) in interactive mode, 60 (1 minute) in non-interactive mode. If --timeout is specified without an argument, a value of 60 seconds is used. If a remote command takes too long, an error message is printed and dmctl immediately exits with the status ETIME.

--traceServer

Trace actions performed in the Domain Manager.

--commands

List dmctl commands and exit.

Also -c.

--help

Print help and exit.

--version

Print program version and exit.

At any given time, dmctl can be attached to (at most) one Domain Manager. The dmctl forwards all accepted commands to the attached Domain Manager, receives a response, and prints it to stdout. It is important to remember that the commands are invoked in the server process. The commands include those in dmctl commands :

Table 2. dmctl commands

Command

Description

attach domain

Attaches to the specified Domain Manager. Once a Domain Manager is attached, other commands can be invoked.

clear <class> :: <instance> :: <event>

Forces a clear of the specified event.

create <class>::<instance>

Creates a new instance in the repository.

consistencyUpdate

Recomputes the codebook.

correlate

Correlates now.

delete <class>::<instance>

Deletes an instance from the repository.

detach

Detaches from the Domain Manager. Another Domain Manager can now be attached with the attach command.

execute <program> [<arg1> ...]

Executes a program. Program should be the base name of the program file, without the suffix or directory. For example, use “name” to load the program name.po.

exit

Exits dmctl.

findInstances <class-pattern>::<instance-pattern>

Lists instances that match given class and instance patterns.

get <class>::<instance>[::<property>]

Lists all properties values or a given property value for a particular class instance.

getClasses

Lists all classes in the repository.

getEvents <class>

Lists all exported events defined in given class.

getEventDescription <class>::<event>

Prints description of given event.

getInstances [<class>]

Lists all instances in the repository, or all instances of the given class.

getModels

Lists all models loaded to the Domain Manager.

getOperations <class>

Lists all operations defined in given class.

getPrograms

Lists all programs loaded to the Domain Manager.

getProperties <class>

Lists all properties defined in given class.

getThreads

Lists all threads that are running in the Domain Manager.

insert <class>::<instance>::<property> <value>

Inserts a value into a table or relationship.

invoke <class>::<instance> <op> [<arg1> ...]

Invokes an operation of given instance.

loadModel <model>

Loads a new MODEL library. The <model> should be the base name of the library. Do not specify a prefix or suffix with the name.

Once a MODEL library is loaded, a prefix or suffix is added to the name. For example, libname.so (Solaris), libname.sl (HP-UX), or name.dll.

After a MODEL library is loaded, the repository can be populated with instances of classes defined in that library.

loadProgram <program>

Loads a new program.The <program> should be the base name of the program file. Do not specify a prefix or suffix with the name.

Once a program is loaded, a prefix or suffix is added to the name. For example, name.po.

After a program is loaded, it can be executed with the execute command.

notify <class> :: <instance> :: <event>

Forces notification of a given event.

ping

Verifies that the Domain Manager is still alive.

put <class>::<instance>::<property> <value1> [<value2> ...]

Sets value of given property.

quit

Quits dmctl.

remove <class>::<instance>::<property> <value>

Removes a value from a table or relationship.

restore <file>

Restores the repository from a file. The <file> should not contain a directory portion; it is read from BASEDIR/smarts/repos/.

shutdown

Shuts down the Domain Manager.

save <file> [<class>]

Saves the repository to a file. The <file> should not contain a directory portion. It is saved to BASEDIR/smarts/repos/. If <class> is specified, then save only the sub-tree rooted at class.

setLocale <locale>

Allows you to set the locale before a Domain Manager attach operation, and to change the locale while the session is open. The setLocale command will print the value of the previous setting on completion of the API call.

The default locale is set for a dmctl session as follows:

  1. The value of the SM_LOCALE environment variable.

  2. If SM_LOCALE is not set equal to a value, then the default locale is set equal to en_US.

status

Displays the connection status.

subscribe <class-regexp>::<instance-regexp>::<event-regexp> ...

Subscribes to problems and events that match the given patterns. The dmctl sends the subscription requests, and then loops indefinitely, printing the received notifications. The program exits only when the Domain Manager is shut down, or when interrupted.

subscribeEvents <class-regexp>::<instance-regexp>::<event-regexp> ...

Subscribes to events that match the given patterns. The dmctl sends the subscription requests, and then loops indefinitely, printing the received notifications. The program exits only when the Domain Manager is shut down, or when interrupted.

subscribeProblems < class-regexp>::<instance-regexp>::<event-regexp> ...

Subscribes to problems that match the given patterns. The dmctl sends the subscription requests, and then loops indefinitely, printing the received notifications. The program exits only when the Domain Manager is shut down, or when interrupted.