Top
Systemwalker Software Configuration Manager Reference Guide
FUJITSU Software

1.4.11 swcfmg_script_execute (Script Execution Command)

Description

Executes scripts for managed servers.

Synopsis

[Windows]

swcfmg_script_execute.exe

-userid <User ID> {-serverid <Server ID> | -ip <IP address>} -script <Script path> [-monitor <Monitoring time>] [-sgluser] [-reboot] [-wait]

[Linux]

swcfmg_script_execute

-userid <User ID> {-serverid <Server ID> | -ip <IP address>} -script <Script path> [-monitor <Monitoring time>] [-sgluser] [-reboot] [-wait]

Options

-userid <User ID>

Performs script execution. Specify the user to be the job administrator of the scripts executed for the user ID. The user must be a tenant administrator, tenant user, or a dual-role administrator that holds privileges to execute the scripts for the specified server.

-serverid <Server ID> | -ip <IP address>

Specify the server ID or IP address of the server which will execute the scripts.

-script <Script path>

Specify the script to execute for the script path.

You can specify the execution method by specifying the options below:

-monitor <Monitoring time>
Specify the monitoring time of the server operation check for the script execution job. Specify the monitoring time using a number between 0 and 1440 in minutes. When 0 is specified, an operation check will be performed once. When a numeric value larger than 0 is specified, the operation check is performed at three-minute intervals within the range of the specified monitoring time. When it is confirmed that the server is operating, the job completes normally. When the operation check cannot be performed during the monitoring time, the process ends abnormally. If this option is omitted, the monitoring time is zero minutes.-sgluser

Executes the script in single-user mode. When this option is specified, the script is executed in single-user mode. After the script is executed, the mode is switched back to the previous mode. When this option is omitted, the script is executed without the switchover of modes.

-reboot

This option restarts the server after script execution. If this option is omitted, servers are not restarted.

-wait

When the job turns to the following status, the command returns. When this option is omitted, after the job starts, the command returns immediately.

  • completed: Completed

  • selecting_abnormal: Selecting (abnormal)

  • completed_abnormal: Completed (abnormal)

  • canceled: Canceled


After this command completes, script execution is executed as a job. The job ID of the job to be executed is output to the standard output.

Return value

Return value

Meaning

0

The command has terminated normally.

[When specifying the "-wait" option]

The status of the job turned to Complete.

10

A parameter error has occurred.

20

The specified I/O path is incorrect.

50

The file description is incorrect.

70

The specified user or server is incorrect.

81

You do not have the privileges required to apply scripts.

90

[When specifying the "-wait" option]

The status of the job turned to Selecting (abnormal).

91

[When specifying the "-wait" option]

The status of the job turned to Completed (abnormal).

92

[When specifying the "-wait" option]

The status of the job turned to Canceled.

100

Systemwalker Software Configuration Manager is not running.

103

Connection to the directory service failed.

104

The operation is not permitted for the admin server.

200

Setup has not been performed.

255

A system error has occurred.

Command location

Admin server

[Windows]

<Systemwalker Software Configuration Manager installation directory>\SWCFMGM\bin

[Linux]

/opt/FJSVcfmgm/bin

Privilege required

[Windows]

[Linux]

Notes

Example

[Windows]

swcfmg_script_execute.exe -userid user001 -ip 192.168.1.1 -script C:\work\script.bat

[Linux]

swcfmg_script_execute -userid user001 -ip 192.168.1.1 -script /tmp/script.sh