Network Deployment (Distributed operating systems), v8.0 > Set up the application serving environment > Administer nodes and resources > Administer nodes remotely using the job manager > Submit jobs
Submit jobs to run commands on a remote host
We can submit the Run command on remote host job to run command-line utilities such as startServer, wsadmin commands, or operating system commands on a remote host. A WAS installation on the remote host is required to run product commands, but is not required for non-product commands.
Before you can run the Run command on remote host job...
- Start the job manager.
- Make a remote host a target of the job manager. In the job manager console, click Jobs > Targets > New Host and complete the fields on the New targets page.
A host is a computer. A remote host typically is a different computer than the one on which the job manager is installed. The remote host does not require a WAS installation unless to run product commands such as startServer or wsadmin.
We can use the administrative console of the job manager or the dmgr to submit a job that runs commands on a remote host. From the console, choose the Run command on remote host job, specify the remote host computer, specify the command to run, review the summary, and submit the job. After the job submission, the job manager runs the specified command and records any messages in job manager stdErr.txt or stdOut.txt logs.
Instead of using a console, you can run the runCommand job script in the AdministrativeJobs command group. See the Administrative job types topic.
To run wsadmin commands in jobs, you can also use the Run wsadmin script job, which additionally enables you to specify script parameters. See information about submitting jobs to run wsadmin scripts.
Procedure
- Click Jobs > Submit from the navigation tree of the administrative console.
- Choose a job to run a WAS command on a remote host target.
- Select the Run command on remote host job type from the list.
The Run command on remote host job is only available in the list if the job manager has a host target. Stand-alone application servers or dmgrs registered with the job manager are targets, but not host targets.
- Optionally specify a description of the job.
- Click Next.
- Choose the job targets.
- Select a group of targets from the list, or select Target names.
- If you selected Target names, then specify a target name and click Add, or click Find and specify the chosen targets on the Find targets page.
On the Find targets page, the job type is automatically set to runCommand to filter search results. Click Find on this page to view the list of hosts in the Excluded targets list. Select the target, click > to move the host name to the Chosen targets list, and then click OK.
- If user authentication is required, specify a user name, password, or any other authentication values as needed.
- Click Next.
- Specify job parameters.
- For Command or script, specify the command or script to run on the host.
For example, to run the versionInfo command in a bin directory of a product installation on the remote host, specify the following command: (AIX) (Solaris)
versionInfo.sh(Windows)versionInfo.batFor Command or script, you can specify a command with arguments; for example: (AIX) (Solaris)
startServer.sh server1(Windows)startServer.bat server1- For Working directory, specify the fully qualified path of the directory where the command resides.
By default, the working directory is set to the home directory of the user.
For example, specify a bin directory of the product installation on a remote host:
(AIX) (Solaris)
/WAS_v800/IBM/WebSphere/AppServer/bin(Windows)C:\WAS_v800\IBM\WebSphere\AppServer\bin(Windows) Avoid trouble: If you use double-backslashes (\\) or a forward slash (/) for directory separators, the job might fail with an error. For Windows operating systems, use a single backslash (\) as a directory separator.
- Click Next.
- Schedule the job.
- Review the summary, and click Finish to submit the job.
Results
The job manager runs the job. If the job options specify the command name and path correctly, the command runs on the host and any messages resulting from the command are written to job manager logs.
For the versionInfo example, a message such as the following is written to the stdOut.txt file in the PROFILE_ROOT/JobMgr01/config/temp/JobManager/job_ID/host_name/logs directory:
-------------------------------------------------------------------------------- IBM WebSphere Product Installation Status Report -------------------------------------------------------------------------------- Report at date and time August 30, 2010 11:20:50 AM EDT Installation -------------------------------------------------------------------------------- Product Directory C:\WAS_v800\IBM\WebSphere\AppServer Version Directory C:\WAS_v800\IBM\WebSphere\AppServer\properties\version DTD Directory C:\WAS_v800\IBM\WebSphere\AppServer\properties\version\dtd Log Directory C:\Documents and Settings\All Users\Application Data\IBM\Installation Manager\logs Product List -------------------------------------------------------------------------------- ND installed Installed Product -------------------------------------------------------------------------------- Name IBM WAS - ND Version 8.0.0.0 ID ND Build Level build_2464 Build Date 8/17/10 Architecture x86 (32 bit) Installed Features EJBDeploy tool for pre-EJB 3.0 modules Sample applications Stand-alone thin clients and resource adapters -------------------------------------------------------------------------------- End Installation Status Report --------------------------------------------------------------------------------For the startServer example that starts server1, the command starts server1 on the host. A message such as the following is written to the stdOut.txt file in the PROFILE_ROOT/JobMgr01/config/temp/JobManager/job_ID/host_name/logs directory:
ADMU0116I: Tool information is being logged in file C:\WAS_v800\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1\startServer.log ADMU0128I: Starting tool with the AppSrv01 profile ADMU3100I: Reading configuration for server: server1 ADMU3200I: Server launched. Waiting for initialization status. ADMU3000I: Server server1 open for e-business; process id is 5384
What to do next
On the Job status page, click the ID of the runCommand job and view the job status. If the job is not successful, view any error messages that result from running the job, correct the error condition, and submit the job again.
Start and stop the job manager
Start and stop the admin agent
Start and stop the dmgr
Submit jobs to run wsadmin scripts
Related
Administrative job types using wsadmin.sh
New target settings
Find targets
Find target resources