Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
Running a Server Script (Saved Script or Ad-Hoc Script)
The Run Script, as shown in the following figure, allows you to run a script on managed servers and consists of the following steps:
You can now execute server scripts that do not change the server (Change Server option is set to No) in parallel with other scripts. This functionality is governed by the following configuration parameters:
* way.server_script.run_read_only_scripts_in_parallel
(Administration >System Configuration> Command Engine): if set to 1, allows scripts that are marked does not change server to run in parallel with other scripts.
* batchbot.max_concurrent_scripts
(Administration > System Configuration > Agent): when set to a non-zero value, determines the maximum number of scripts (including pre/post package scripts) that will be run in parallel by the agent. This parameter needs a 10.21 or latest SA Agent.
See Ways to Open the Run Script Window on how to access the Run Script window. If you access the Run Script window from the Device list or Device Explorer, the first step in the window is Script. If you access the Run Script window from the Library, the first step in the Run Script window is Servers and Groups.
This section also provides information on the following topics:
Servers and Groups
This step allows you to specify the servers or server groups for executing the script. In this step, you can add and remove servers or server groups from the list.
If you choose the option Now, then the membership is determined based on the time when you made the selection. As a result the script is executed on the servers that were in the group when you selected the option. Changes to the group membership does not affect the list of servers on which the script will be executed.
If you choose the option Runtime, then the membership is determined when the script execution job is run. The script is executed on the servers present in the server group when the job is run. Changes to group membership is reflected in the list of servers when is script is executed.
To be able to select the Runtime option, the “Allow Run Refresh Jobs” permission is required. See the SA 10.50 Administration Guide for more information on permissions.
To select servers and groups perform the following steps:
- Open the Run Script window from one of the methods described in Ways to Open the Run Script Window.
- In the Run Script window, select the step Servers and Groups.
- (Optional) Click Include Server/Group to add servers or server groups to the list or select a server or server group and click Exclude to remove servers from the list.
- For a server group, in the Server Group Calculation field, select the option Now to execute the script on the servers that were in the group when you made the selection. Select the option Runtime to execute the script on the servers when the job is run.
- Click Next to proceed to the Script step.
Script
This step allows to select a saved script or define an ad-hoc script to be executed on managed servers. See Types of scriptsfor information on the script types.
To select a saved script perform the following steps:
- To select a saved script, select the option Select Saved Script.
- From the Name drop-down list select the script or click Select Script to open the Select Script window. Select the script from the Select Script window.
- The script properties such as version, type, location are displayed in the content pane. To view the contents on the script, click View Script. The contents of the script are displayed in the Run Script window.
- Click Next to proceed to the Options step.
To define an ad-hoc script perform the following steps:
- To select an ad-hoc script, select the option Define Ad-hoc Script.
- From the Type drop-down list, select the script type.
- Enter the contents of the script in the Script Contents field or click Import Script File to import a script.
If you import a script that uses Unicode (UTF8) encoding and your computer's regional language settings are set to English, and then you export the script and attempt to execute it, you may encounter errors because Unicode (UTF8) encoding may add a "." or other special character at the beginning of the script. If this occurs, simply edit the script to remove the extraneous characters. - Click Next to proceed to the Options step.
Options
This step allows you to specify the runtime options and output options for executing a script. In this step you can specify whether to execute the script as root or Local System or as a specified user. You can also specify the script time-out value, any additional parameters for executing the script, and the output options for the script.
To specify the runtime and output options for a script perform the following steps:
- In the Runtime User field select root (for UNIX) , Local System (for Windows) or Super User (for Unix and Windows) to execute the script as root or Local System.If the list of servers includes both Unix and Windows and you select Super User, the script will be executed as root on the Unix servers and as Local System on the Windows servers. To execute a script on both Unix and Windows, the script type must be supported on both platforms. To execute the script as root or Local System, you require the appropriate permissions. See the SA 10.50 Administration Guide for information about the permissions required for executing scripts.
Or, select Name and enter user name and password to execute the script as a specified user. To execute the script simultaneously across multiple servers or server groups, you must use the same user name and password across all the servers. - (Windows only) Enter the domain name in the domain field.
- In the Script timeout field enter the script timeout value in minutes. The time out value is the amount of time required for a script to complete execution activities on a server. If the script is not executed when the timeout value is reached, then the script is stopped by SA and a script error occurs. Select a timeout value greater than the time required for execution to complete.
- In the Specify any needed parameters for this script execution field, enter any parameters if required.
- In the Output Options, select Discard all script output to discard script output or else select Retain script output.
- Select the output size of the script from the Size of the output to retain drop-down list.
- Click Next to proceed to the Scheduling step.
Scheduling
This step allows you to schedule the script execution job. You can choose to run the script execution job immediately, or on a specified date and time, or on a recurring basis.
To schedule a script execution job, perform the following steps:
- In the Schedule Frequency section, choose to run the script once, daily, weekly, monthly, or on a custom schedule. Select any one of the following options:
- Once: Choose this option to run the job immediately or only once at a specified date and time.
- Daily: Choose this option to run the job on a daily basis at a specified time.
- Weekly: Choose this option to specify the day or days of the week to run the job.
- Monthly: Choose this option to specify the months to run the job, and the days of the month.
- Custom: In the Custom Crontab string field, enter a string the indicates a time schedule. The crontab string can include serial (1,2,3,4) and range (1-5) values.
- In the Time and Duration section, for each type of schedule, specify the start time for the job. You must also specify the start date and end date for the job.
- In the Time Zone section, choose a time zone or accept the default, which is set according to the time zone settings in your user profile.
- Click Next to proceed to the Notifications step.
Notifications
This step allows you to set email notifications to alert users on the success or failure of a job. You can also associate a Ticket ID with the job. This setting is optional.
To set email notifications, perform the following steps:
- Click Add Notifier.
- Enter the addresses in the Email Address of Recipient field.
- For each recipient, select the check box for when to send an email notification:
- On Success: sends email to recipient if the job succeeds.
- On Failure: sends email to recipient if the job fails.
On Termination: sends email to recipient if the job is terminated.
Termination occurs when you stop an actively running job via the End Job action.
This notification does not apply to jobs that are cancelled before they are run.
- Enter an ID to be associated with this job in the Ticket ID field.
- Click Next to proceed to the Job Status step.
Job Status
This step allows you to start the job, view the job progress, the job results, the script output for a managed server, and export the script output from all the servers.
SA supports the following file formats for exporting script output results:
- A Zip file with folders for each managed server
- A Zip file containing no folders
- Consolidated raw text file
- Consolidated formatted text file
- Consolidated CSV file
You can also view jobs in the Jobs Log window of the SA Client. See Browsing job logs for information about job logs.
To start a job, perform the following steps:
- To start the job, click Start Job.
If you selected Immediately in the Scheduling step, the job will begin now. If you scheduled the job for a later time, the job will run later. You can then view the job in the Jobs Log window of the SA Client. - The job’s progress information appears in the Job Status window. You can view the server on which the script was executed, the job status, and the exit code. If the exit code is zero, then it indicates that the script is executed successfully. If the exit code is non-zero, then it indicates an error during script execution.
If the job status is displayed as Pending Approval, then the job is blocked until it is approved by a process that is external to SA. See Browsing job logs for information about job status. - (Optional) To view the script output from a managed server, select the managed server and script output appears below the table.
- (Optional) To view the script output from all the managed servers, select the option Show output in table. The output for each server appears in the Output column in the table.
- (Optional) To view the output for all the servers in separate columns, select the option Show output in table and enter the delimiter character in the Delimiter checkbox. The output for each server appears in separate columns in the table.
- (Optional) To export the script output results, click Export All Results. In the Browse window specify the location and the file type and click Export.
- Click Close to exit the Run Script window.
Terminating an Active Script Execution Job
You can stop a script job that is actively running. For example, you may need to stop a job that is producing erroneous results or will run beyond an allotted maintenance window. It should be noted that the termination process does not stop the script on a server or device where it is already running; it prevents the script from running on subsequent servers or devices.
You can terminate a script execution job from the Run Server Script window or from the SA Client Jobs and Sessions window.
Terminating an active script execution job has the following results:
- After the cancellation request is received, work is not started on any additional servers.
- If a script has already started on a server, it will be completed; however, it will not be started on additional servers.
The Job Status view of the Run Server Script window will indicate the job status for each server on which the script was run:
Server Status |
Explanation |
---|---|
Cancelled |
The script did not run on the listed device. |
Succeeded |
The script completed running on the listed device. |
The Job Logs view of the SA Client Jobs and Sessions window will indicate the job status of the script:
Job Status |
Explanation |
---|---|
Terminating |
The termination request has been received and the job is in the process of ending. |
Terminated |
The termination process has completed. |
Permissions for Terminating Active Jobs
In general, users with the permission to start a job will be able also be able to terminate that job. In addition, users having Edit or Cancel Any Job permission are able to soft-cancel any running job.
See the SA 10.50 Administration Guide for SA permissions details.
To terminate an active script execution job from the Run Server Script window:
Access the Run Server Script window and start the job.
See the following instructions for details:
- Ways to Open the Run Script Window
- Running a Server Script (Saved Script or Ad-Hoc Script)
- Running an OGFS Script
From the Run Server Script window, click End Job. (This option only appears if the job is in progress.)
The End Job warning dialog will be displayed advising you that the job will complete the scripts that have been started on a server, but will not start any scripts on remaining servers.
Click OK to confirm that you wish to terminate the job. The Job Status window displays the progress of the termination.
If the job termination was successful on a particular device, it will be indicated by Cancelled status. Servers where the script completed will be indicated by Succeeded status. To see details about the server’s status, select the server. Details will be displayed in the lower pane.
When the termination is complete, you can also view the job in the SA Client Job Log.
From the SA Client navigation pane, click Jobs and Sessions. The Job Logs view appears with your job listed with Terminated status.
To terminate an active script execution job from the SA Client Jobs and Sessions window:
From the SA Client navigation pane, click Jobs and Sessions. The Job Logs view appears.
From the Status filter, select In Progress to find running jobs.
Select View > Refresh from the menu to refresh the list. The content pane displays jobs with In Progress status.
You can additionally filter the list by the type of job (such as Run Server Script) from the Type filter.
In the content pane, select the job that you want to terminate.
Select Action > End Job. (This option only appears if the selected job is in progress.)
When the termination process is complete, the job will have Terminated status, as shown in the following figure.
Cancelling a Scheduled Script Execution Job
You can cancel scheduled jobs that are not in progress from the SA Client Jobs and Sessions window. When you cancel a scheduled script execution job, the entire job is cancelled and it appears in the Job Log queue with Cancelled status.
To cancel a schedule job:
- From the SA Client navigation pane, select Jobs and Sessions. The Job Logs window appears in the content pane.
- In the Status filter, select: Scheduled.
- Select the scheduled job that you want to cancel.
- From the menu, select Action > Cancel. The job appears in the Job Log with Cancelled status.
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to hpe_sa_docs@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: