16.6 Remote Execute Policy

The Remote Execute policy is used to execute any Script, Binary, or Java file.

To configure the Remote Execute policy:

  1. In the ZENworks Control Center, click the Policies tab.

  2. In the Policies list, click New, then click Policy to display the Create New Policy page.

  3. In the Policy Type list, click Remote Execute Policy, then click Next to display the Policy Name page.

    Policy Name page
  4. Fill in the fields:

    • Policy name: (Required) Provide a unique name for the policy. The name you provide displays in the ZENworks Control Center interface, which is the administrative tool for ZENworks Linux Management.

      For more information, see Section C.0, Naming Conventions in the ZENworks Control Center.

    • Folder: (Required) Type the name or browse to the folder that this policy will be created in. Folders display in the ZENworks Control Center.

    • Description: Provide a short description of the policy. This description displays on the policy's Summary page in the ZENworks Control Center interface.

  5. Click Next.

    Remote Execute Policy page
  6. Select the desired options:

    Executable type: Select an executable type to run on a managed device (script, binary, or Java). Depending on the executable type you select, different options are available, as described below.

    Maximum waiting time: Indicate the waiting time after starting the script, binary, or Java program. The following table explains the available options:

    Option

    Description

    Do not wait

    The Remote Execute enforcer does not wait for the program to be completed.

    Wait till the program completes the execution

    The Remote Execute enforcer waits for the program to be completed.

    Wait for <n> sec

    Indicates how many seconds the Remote Execute enforcer should wait after starting the program.

    NOTE:The launched program is not terminated by the enforcer if you select the Do not wait or Wait for <n> sec options.

    (Conditional) If you chose Script in the Executable Type field in Step 6, the following options are available:

    Script to run: Select an option from the drop-down list:

    • Specify a file: Fill in the fields:

      Script filename: Specify the complete absolute path, including the filename, of the script you want to run on a managed device.

      Script parameters: Specify any parameters to be passed to the specified script file. If you want to specify Shell operators such as redirection operators in Script parameter, then you must select Script in the Executable Type field and Define your own script in the Script to run field.

      Script engine: Specify the name and location of the script engine that runs the script. For example, /usr/bin/perl.

      Script engine parameters: Specify any parameters to be passed to the specified script engine.

    • Define your own script: Type your script in the box.

    (Conditional) If you chose Binary in the Executable Type field in Step 6, the following options are available:

    Executable file name: Specify the complete absolute path, including the filename, of the binary program you want to run on a managed device.

    Executable file parameters: Specify any parameters to be passed to the specified binary program.

    NOTE:You cannot perform shell operations, such as redirection using the executable type Binary. You can use Executable file parameters to pass only those parameters that are required by the executable specified in the Executable file name field. If you want to use shell operations, define your own script.

    (Conditional) If you chose Java in the Executable Type field in Step 6, the following options are available:

    Java program name: Specify the Java program you want to run on a managed device.

    Program parameters: Specify any parameters to be passed to the specified Java program.

    Java Runtime Executable (JRE): Specify the complete path, including the Java Runtime Executable (JRE) name. JRE is used to interpret the Java binary file.

    JRE parameters: Specify the parameters to be passed to the Java Runtime Executable (JRE).

    NOTE:The Own Defined Script specified in the Remote Execute policy is executed in the shell specified by the environment variable SHELL. The value of the variable SHELL is taken from the environment in which ZENworks Management daemon runs. If a value is not specified, then /bin/sh is used, which is a default value.

  7. Click Next to display the Summary page.

  8. Click Finish to create the policy as configured according to the settings on the Summary page. If you click Finish, the Remote Execute policy is created but it does not have devices assigned or a schedule specified. At some point in the future, you need to configure additional options for the policy by continuing with Section 17.4, Assigning Policies.

    or

    Click Next to display the Policy Assignment page to perform the following tasks:

    • Specify assignments for this policy

    • Specify the schedule for this policy

    • Specify groups for this policy

    Policy Assignments page
  9. Assign the policy to the devices.

    1. Click Add to browse for and select the appropriate Server or Workstation objects.

      You can also select Folder or Group objects.

    2. Click the down-arrow next to Servers or Workstations to expand the list, then click the underlined link in the Name column to select the desired objects and display their names in the Selected list box.

      Assigning a policy to a Group object is the preferred method of assigning the policy. Assigning the policy to a large number of objects (for example, more than 250) might cause increased server utilization.

    3. Click OK.

  10. Click Next to display the Policy Schedule page, then select the schedule to apply to the assignments.

    The settings you configure on this page determine when the policy is applied to devices.

    See Section 15.3, Schedules for information about the available schedules.

    NOTE:If you select Day of the Week Specific as the schedule type and Start Immediately at Start Time, and then Repeat until End Time Every, and if the Start Time and End Time spans midnight, the Remote Execute policy is executed only at the Start Time and fails to repeat execution.

  11. Click Next to display the Policy Groups page.

    Policy Groups page
  12. (Optional) Click Add to open the Select Groups dialog box, then click the underlined links in the Name column to select the desired policy groups and display their names in the Selected list box.

    Using policy groups eases administration efforts by letting you group several policies so you can use common assignments, schedules, and so forth, rather than configuring these settings for each policy you create. For more information, see Section 17.3, Creating Policy Groups.

  13. Click Next to display the Finish page.

  14. Review the information on the Finish page, making any changes to the policy settings by using the Back button as necessary. Click Finish to create the policy as configured per settings on the Finish page.