Description
Use the
tacmd executeAction command
to execute the system command provided in the given Take Action command.
You must log in by using the
tacmd login command before running
the
tacmd executeAction command. If the following options are
specified, certain Take Actions fail:
- -e | --stderr
- -o | --stdout
- -r | --returncode
- -l | --layout
- -p | --path
For more information, see 'The tacmd executeaction command fails
for certain Take Actions' entry in the
IBM Tivoli Monitoring Troubleshooting
Guide.
Note: This command is intended for executing short
CLI based actions/commands on the remote target. It should not be
used to execute long running, GUI, or interactive executables.
CLI syntax
tacmd executeAction
{-n|--name} ACTIONNAME
{-m|--system} MANAGEDSYSTEMNAME
[{-t|--type} TYPE]
[{-d|--detailtextname} TYPEDESC ]
[{-o|--stdout}]
[{-e|--stderr}]
[{-r|--returncode}]
[{-l|--layout}]
[{-p|--path}]
[{-u|--timeout} TIMEOUT]
[{-c|--cmdvalue} COMMANDVALUE] VALUE=.......
where:
- -n|--name
- Specifies the name of the action to be executed.
- -m|--system
- Specifies one or more managed systems on which the action is to
be executed. For this command, the specified system cannot be a Tivoli
Enterprise Portal Server managed system. Valid values include letters
(upper or lower case), numbers, periods (.), at symbols (@), dollar
signs ($), asterisks (*), number signs (#), underscores (_), colons
(:) or blanks ( ).
- -t|--type
- Specifies the application type name. Specify a two-digit character
code of the system type name to execute the action.
- -d|--detailtextname
- Specifies the application detail text name. Specify detail text
of system type name to execute the action.
Note: The -d|--detailtextname
option should be used along with -t|--type option to filter the action
having the same name and the same type.
- -o|--stdout
- Requests the standard output to be captured. For section separators,
use the -l|--layout option. If the action command redirects standard
output, then nothing will be captured.
To use this option, the
hub monitoring server, the targeted monitoring agents, and any remote
monitoring servers to which the targeted agents are connected must
be at IBM Tivoli Monitoring v6.2.2 Fix Pack 2 or later. Otherwise,
the option is ignored. This option is ignored if the specified system
is an i5/OS or z/OS monitoring agent.
- -e|--stderr
- Requests the standard error to be captured. For section separators,
use the -l|--layout option. If the action command redirects standard
error, then nothing will be captured.
To use this option, the
hub monitoring server, the targeted monitoring agents, and any remote
monitoring servers to which the targeted agents are connected must
be at IBM Tivoli Monitoring v6.2.2 Fix Pack 2 or later. Otherwise,
the option is ignored. This option is ignored if the specified system
is an i5/OS or z/OS monitoring agent.
- -r|--returncode
- Requests the return code to be captured. For section separators,
use the -l|--layout option.
To use this option, the hub monitoring
server, the targeted monitoring agents, and any remote monitoring
servers to which the targeted agents are connected must be at IBM
Tivoli Monitoring v6.2.2 Fix Pack 2 or later. Otherwise, the option
is ignored. This option is ignored if the specified system is an i5/OS
or z/OS monitoring agent.
- -l|--layout
- Requests the command string to be captured and adds section separators
to the results file.
To use this option, the hub monitoring server,
the targeted monitoring agents, and any remote monitoring servers
to which the targeted agents are connected must be at IBM Tivoli Monitoring
v6.2.2 Fix Pack 2 or later. Otherwise, the option is ignored. This
option is ignored if the specified system is an i5/OS or z/OS monitoring
agent.
- -p|--path
- Specifies the name of the directory where the results files are
saved. You must specify one of the following options before the directory
and results files are created, either when the directory name is specified
or when the default directory is created:
- -o|--stdout
- -e|--stderr
- -r|--returncode
For section separators, use the -l|--layout option. If the
specified directory does not exist, then it is created. If the -p|--path
option is not specified, but if any of the following options is defined,
then a default directory is created where the command issued:
- -o|--stdout
- -e|--stderr
- -r|--returncode
The default directory name has the following format:
TACMD_CXA_ActionName_Timestamp_RND8Char
In
this directory, one file for each managed system is created by using
the following format:
TACMD_CXA_ExecutedAction_ManagedSystemName_Timestamp_SEQChar.log
Where:
- ManagedSystemName
- Specifies the managed system name, and is filtered removing special
characters such as colons (:) and substituting them with underscores
(_).
- ActionName
- Specifies the name of the action.
- ExecutedAction
- Specifies the command run on the managed system, and is filtered
removing special characters such as colons (:), and it is truncated
to 64 characters.
- Timestamp
- Specifies the timestamp, and is given in the format YYYYMMDDHHMMSS.
- RND8Char
- A random string composed of eight random numbers.
- SEQChar
- A random string composed of sequential numbers starting from 0.
To use this option, the hub monitoring server,
the targeted monitoring agents, and any remote monitoring servers
to which the targeted agents are connected must be at IBM Tivoli Monitoring
v6.2.2 Fix Pack 2 or later. Otherwise, the option is ignored. This
option is ignored if the specified system is an i5/OS or z/OS monitoring
agent.
- -u|--timeout
- Specifies the timeout value of the command request. The TIMEOUT
is the number of seconds allowed for the specified command to complete.
The range is 1 to 32400 seconds. The command is not stopped if the
timeout limit is reached, but the output is not captured.
To use
this option, the hub monitoring server, the targeted monitoring agents,
and any remote monitoring servers to which the targeted agents are
connected must be at IBM Tivoli Monitoring v6.2.2 Fix Pack 2 or later.
Otherwise, the option is ignored. This option is ignored if the specified
system is an i5/OS or z/OS monitoring agent.
- -c|--cmdvalue
- Specifies the input value for the command to execute. If a Take
Action command value requires some input from the user to execute
the command, use the -c|--cmdvalue option to specify those values.
The command input value should be given within double quotation marks
under the property name VALUE as value=INPUTCOMMANDVALUE. A comma
is used as a delimiter to specify more than one input value. For example
value=inputvalue1,inputvalue2,inputvalue3
Certain
input values are optional. You can provide a value for those inputs.
You can also specify a comma for those that you do not want to provide
a value. For example:
value=inputvalue1,,inputvalue3
The
viewaction command
helps to identify the input value. Checking for the number of ampersand
characters under the column command tells you exactly the number of
input values that have to be provided to execute the Take Action command.
CLI example
This example executes the action
command named "URL Add" of type UM on the managed system LSC334ASFSdp:UAGENT00.
–c provides the input values required by the action command to execute.
tacmd executeaction -n "URL Add" -t um -m LSC334ASFSdp:UAGENT00
-c value=http://w3.ibm.com,w3,1000,105,object
This
example executes the action command named "Sample Linux Kill Process"
from a Windows environment to terminate running process 6383 on a
Linux endpoint. This command also requests that the standard output,
standard error, and return code be captured with the response file
having section separators added, and the file saved in the
c:\temp directory:
tacmd executeaction -m LINUX:LZ -n "Sample Linux Kill Process" -t lz -c value="6383"
-e -o -r -l -p c:\temp
Related commands
Return to Table 1.