Issuing UNIX commands from OMEGAMON XE on z/OS

The Tivoli Enterprise Portal Take Action feature lets you enter a command or stop or start a process on any system in your network where one or more Tivoli OMEGAMON XE agents are installed, and you can add Take Action commands to any situations you create using OMEGAMON XE on z/OS attributes.

By default, any command issued on behalf of OMEGAMON XE on z/OS is issued as a z/OS command. The only result returned is whether or not the command appears to have started successfully. However, prefixing a command with one of the following causes the command to be issued as a UNIX command. Note that the colon (:) following the command is required.

Thus, for example, D OMVS is issued as a z/OS command. Alternatively, omvs:ps -ef is issued as a UNIX command. As with z/OS commands, the only result returned is whether or not the command appears to have started successfully.

Using one of the prefixes you can issue a UNIX program name as a command. You can also issue UNIX shell commands.

By default, the output of both z/OS and UNIX commands are written to the z/OS system log. You cannot redirect the output of a z/OS command. However, you can redirect both the input stream and output of a UNIX command by following standard UNIX redirection conventions. For example, the command omvs:ps -ef>/tmp/myoutput sends the output of the ps command to a file called /tmp/myoutput. Redirect command output to a file for later examination and to avoid cluttering the z/OS log.

Each UNIX command is run as a process in a separate address space using the shell /bin/sh. When OMEGAMON XE on z/OS is used to start a long-running UNIX command, you may notice an address space that persists until the command ends. This address space is in addition to the one running OMEGAMON XE on z/OS and the one running the command itself. You can avoid the extra address space by running the command in the background. To do so, end the command line with the UNIX shell symbol & (ampersand).

UNIX commands are issued in an environment having these characteristics:

Before using commands as part of Tivoli Enterprise Portal event-driven interface, you should run some simple tests from the user interface to ensure that commands are working as expected. For example, issuing the Take Action command omvs:set>/tmp/cantest should result in the output of the set command being placed in the file /tmp/cantest.