Name

xdistc — command-line interface to VRTSsfmh distributor

SYNOPSIS

xdistc [OPTIONS] --push localfile remotefile

xdistc [OPTIONS] --run --command arg1 arg2..

xdistc [OPTIONS] --push localfile remotefile --run --command arg1 arg2..

xdistc --results --id requestid [--wait duration]

DESCRIPTION

xdistc is the command-line interface to the VRTSsfmh distributor. You can use xdistc to copy files or run commands across all managed hosts in a centrally managed domain. You can perform these tasks on the available hosts that are currently running, and on the unavailable hosts when they are started. When you run xdistc, the task that is specified with it continues to run in the background even when xdistc has stopped running.

You can run xdistc only from a Management Server host that has the xprtld daemon running. You must be logged on as root to run xdistc.

OPTIONS

--push localfile remotefile

Copies a file to multiple managed hosts. The symbolic names $TMPDIR, $VARDIR, and $TMPFILE can be used as destination file paths. $TMPDIR typically points to the /tmp directory, but it may vary on Windows managed hosts. $VARDIR points to the /VRTSsfmh/var directory. To use, append the file name after the symbolic name. For example, $TMPDIR/myfile.txt, or $VARDIR/myfile2.txt. $TMPFILE creates a temporary file name ensuring no collision with other files in /tmp. This is useful with the --run option.

You can specify only a few designated directories as the destination.

To overwrite existing files while copying, use the --force option.

--run --command arg1 arg2..

Runs a command on multiple managed hosts. In this form, a command is used from commands previously whitelisted on each destination host. The arguments after the double dash are passed directly to the command. You can specify a request ID with the --id option. If the request ID is not specified, a random ID is internally created.

--push localfile remotefile --run --command arg1 arg2..

Used to copy files and run a command on multiple hosts simultaneously. This option is useful when you want to copy an executable file to multiple managed hosts, and run it.

--results

Retrieves the stdout and stderr results from a run request. You can specify this option with the --run option to view the results of the command that is executed. You must specify the request ID if you use the --results option without the --run option. You can use the --wait option to specify the time the xdistc script should wait to obtain the results.

--os osname

Specifies the operating system. The task that is specified with xdistc is run on the managed hosts that have the specified operating system running. The osname must be specified as one of the following: SunOS, Linux, HP-UX, AIX, Windows. You can also specify multiple operating systems. For example, to specify AIX and Linux, use '/AIX|Linux/', including the single quotes.

--cpu cputype

Specifies the processor. The task that is specified with xdistc is run on the managed hosts that have the specified processor. The cputype must be specified as one of the following: sparc, x86_64, powerpc, x86, x64, i386, i686.

--host hostname

Specifies the host. The task that is specified with xdistc is run on the specified managed host. You can specify the option multiple times to specify multiple hosts.

--hostfile filename

Specifies a file that contains the names of managed hosts. The file must be whitespace delimited. The task that is specified with xdistc is run on the managed hosts that are specified in the file.

--when spec

Specifies the state of the managed hosts. The possible values for spec are 'now', 'up', or 'now,up', without the single quotes. If you specify 'now', the task that you specify with xdistc is run on the managed hosts that are already started. If you specify 'up', the task that you specify with xdistc is run on the managed hosts that are being started or restarted, or the managed hosts that are being added to the centrally managed domain. The default value of spec is 'now,up'.

--id requestid

Specifies the request ID. You can use the --id option with the --push or --run options to assign a request ID. It also collects the output when it is used with the --results option. If not specified, an ID is generated internally.

--ttl timespec

Specifies the time that xdistc should remember the request and the output results of the request. You can specify the time for which xdistc should attempt to send the request to the managed hosts. The value of timespec can be in days, hours, or minutes. For example, you can use any one of the following values to specify that xdistc should remember the request and the output results for a day: 1d, 24h, or 1440m, where d stands for days, h stands for hours, and m stands for minutes. You can also specify one of the following values for timespec: 'complete', or 'forever', without the single quotes. If you specify timespec as 'complete', xdistc deletes the request after it has run the task on the specified hosts. If you specify 'forever', the request is not deleted automatically.

--wait seconds

Used with the --results option to specify the time the xdistc script should wait to obtain the results. You must specify the time in seconds. The default value is 0 seconds, which causes the xdistc script to wait indefinitely for the results.

--force

Specifies that existing files should be overwritten when files are copied to the managed host.

--delete

Specifies that the copied file should be deleted from the managed host after the command that is specified with the --run option has completed. The --delete option is used only when the --push option and the --run option are used together.

--permission p

Specifies the access permissions for the file that is copied to the managed host. You can specify the access permission as an octal number. For example, 500, or 444.

--whitename name

Specifies that after a file is copied, it should be included in the whitelist to be run later.

--user username

Specifies the user name to be used when the task is run from xdistc on each managed host. The default is user name is vxss:///sfm_admin//.

--uri uri

Specifies a raw URI to call. This is a lower-level interface above the --push and the --run options that is used to invoke arbitrary URLs.

--d option=value

Specifies the additional values that xdistc passes as form data to remote URLs.

NOTES

The default location of xdistc is /opt/VRTSsfmh/bin/xdistc.

The default log file for xdistc is /var/opt/VRTSsfmh/logs/xdist.log.

Windows-based Management Server does not support the xdistc command.

EXAMPLES

This section provides usage examples for xdistc.

EXAMPLE 1:

To copy the script.sh file to all Linux managed hosts, run it, and display the results. The file will be deleted from the managed host after it is run. The request will remain active on Management Server for a day. The command will be sent to any new hosts joining the domain during this time, and results can be collected until the request is automatically cleaned up on Management Server.

xdistc --ttl 1d --os Linux --push script.sh /tmp/remote.sh --run --delete --results

EXAMPLE 2:

To copy the /root/script.sh file to all managed hosts, set its access permissions, and whitelist it. The request will remain active on Management Server for a day. The command will be sent to any new hosts joining the domain during this time, and results can be collected until the request is automatically cleaned up on Management Server.

xdistc --ttl 1d --push /root/script.sh /var/opt/VRTSsfmh/script99.sh --permission 755 --whitename script99

EXAMPLE 3:

To run the whitelisted script99 command with arguments. The request will remain active on Management Server for a day. The command will be sent to any new hosts joining the domain during this time, and results can be collected until the request is automatically cleaned up on Management Server.

xdistc --ttl 1d --run -- script99 arg1 arg2

EXAMPLE 4:

To run script99 using the whitelist and the lower-level URI interface. The request will remain active on Management Server for a day. The command will be sent to any new hosts joining the domain during this time, and results can be collected until the request is automatically cleaned up on Management Server.

xdistc --ttl 1d --uri admin/whitelist.pl/run --d argv=["script99","arg1","arg2"]