You are here: Plan > Create a Script Policy

Create a Script Policy

A Script policy defines a set of commands to run on the ECX appliance. Use the Script policy feature to add functionality to ECX.

A Script policy includes a user-defined script as well as other policy parameters.

A script can consist of one or many commands, such as a shell script. Command entries may include any entry that is valid for a Linux CentOS command shell. The author of the script must be familiar with the command, options, and parameters.

As the script runs, ECX interprets a return code of 0 as success and subsequent values as follows:

  • Return codes 1-125 indicate a failure, the meaning of which is specific to the command or shell script invoked
  • Return code 126 indicates the script command was found but is not executable
  • Return code 127 indicates that the script command was not found
  • Return codes 128-255 indicate that the command abnormally terminated. The formula 128+N is used with N representing the signal the process terminated on
  • Values outside the range of 0-255, in both negative and positive values, are wrapped around the same series of return codes and are matched to a corresponding code. When positive error codes display over 255, they read as follows: 256=0, 257=1, 258=2, etc. When negative return codes display, the corresponding codes are as follows: -1 = 255, -2 = 254, -3 = 253, etc.

 

BEFORE YOU BEGIN:

  • Ensure that the applications and programs called from your script are properly configured.
  • Ensure that paths are properly set up.
  • Ensure that authentication is properly set up.
  • Ensure that schedules, SMTP providers, and other relevant providers are added in ECX. See Create a Schedule and Register a Provider.

To construct a Script policy:

  1. Click the Plan Plan tab icon tab. On the Views pane, select Policies Reports icon.
  2. Click the All Policies tab, click New New icon, then select Script in the System column. The Script Policy Editor opens.
  3. Click the 1: Scripts tab. On the Scripts pane, enter the first command of your script in the command text box, and optionally enter a tag or remark in the corresponding description text box. Then click Add Add Node icon .
  4. Continue to add commands. Use the reorder, edit, and delete options to assist you. Your script can consist of one or many commands.
  5. Click the 2: Options tab after all the commands are entered. Specify the applicable options for running the policy.
  6. Run scripts in order
    Select Run scripts in order for the commands in the policy to run sequentially. The policy runs the first command and when it finishes it runs the next one. Clear this option for the commands to run concurrently.
    Stop execution on failure
    Select Stop execution on failure for the policy to stop running as soon as one of the commands fails. Clear this option for the policy to continue to run after one of the commands fails. This option is only applicable if Run scripts in order is selected.

  7. Click the 3: Notification tab. Select the notification options for your policy.
  8. SMTP Server
  9. From the list of available SMTP resources, select the SMTP Server to use for job status email notifications. If an SMTP server is not selected, an email is not sent.
  10. Email Address
  11. Enter the email addresses of the status email notifications recipients. Click Add Add Node icon to add it to the list.
  12. Click the 4: Schedule tab. Select Start job now to create a policy that starts the job immediately. Select Schedule job to start at later time to view the list of available schedules. Optionally select one or more schedules for the job. As each schedule is selected, the schedule's name and description displays. A policy paired with a schedule is a job.
  13. Note: To create and select a new schedule, click Views, then select Schedules Schedule icon. Create a schedule, then return to the policy editor, refresh the Available Schedules pane, and select the new schedule.
  14. Click the 5: Finish tab. Enter a name for your policy and a meaningful description. When you are satisfied that the policy-specific information is correct, click Finish.
  15. Note: If you selected the Start job now option, the job runs.

  16. Click the All Policies tab. Your new policy appears in the Script Policy list.

NEXT STEPS:

  • If you do not want to wait until the next scheduled job run, run the job session on demand. See Start, Stop, and Halt a Job Session.
  • Track the progress of the job session on the Monitor tab. See Monitor a Job Session.
  • If notification options are enabled, an email message with information about the status of each task is sent when the job completes.

 


Catalogic ECX™ 2.4

© 2016 Catalogic Software, Inc. | All rights reserved. | 7/15/2016

MySupportKnowledge Base | Trademarks | info@catalogicsoftware.com