7.1 Configuring System Variables

The System Variables page lets you define variables that can be used to replace paths, names, and so forth as you enter data in various ZENworks Control Center fields. System variables defined on this page can be used on all objects in your ZENworks Management Zone.

System variables can be overridden at the device or folder level. If you add the same system variable to a device or folder, but give it a different value, the new variable value overrides the inherited system variable value. A variable on the device level overrides the same variable on the folder level, which overrides the same variable on the system level.

The following sections provide additional information:

7.1.1 Creating System Variables

To provide a variable at the device level:

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

  2. Navigate to and click the desired device, click the Settings tab.

  3. Click System Variables, then click Override settings.

  4. To add a system variable, click Add, then fill in the Name and Value fields.

    When specifying the variable in an object's field, use the following syntax:

    ${VAR_NAME}

  5. Click OK.

    Click the icon for additional help

To provide a variable at the folder level: from the ZENworks Control Center, click the Devices tab, click the (Details) link next to the desired folder, click the Settings tab, then click System Variables. Click the icon for additional help.

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

  2. Click the (Details) link next to the desired folder, click the Settings tab, then click System Variables, then click Override settings.

  3. To add a system variable, click Add, then fill in the Name and Value fields.

    When specifying the variable in an object's field, use the following syntax:

    ${VAR_NAME}

  4. Click OK.

    Click the icon for additional help

To set system variables for your ZENworks system:

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

  2. Click System Variables.

  3. To add a system variable, click Add, then fill in the Name and Value fields.

    When specifying the variable in an object's field, use the following syntax:

    ${VAR_NAME}

  4. Click OK.

7.1.2 Using Variables in ZENworks Policies: A Sample Use Case

In this scenario, you have a SLES 9 and a SLES 10 managed device. Both devices have a common file, deviceid. On SLES 9, the file is located at /etc/opt/novell/zenworks/zmd, and on SLES 10 it is located at /etc/zmd. Assume that you want to place a copy of deviceid in the /tmp directory on both devices by using the Remote Execute policy. Instead of creating two Remote Execute policies, one each for the SLES 9 and SLES 10 managed device, you can create one policy by using system variables.

Perform the following tasks in the order listed:

Creating a System Variable for the SLES 9 Managed Device

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

  2. Click Servers.

  3. From the list of servers, click the SLES 9 managed device, then click the Settings tab.

  4. Click System Variables, then click Override settings.

  5. In the System Variables panel, click Add, then fill in the following details:

    • Name: source_path

    • Value: /etc/opt/novell/zenworks/zmd

  6. Click OK.

  7. Click Apply, then click OK.

Creating a System Variable for the SLES 10 Managed Device

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

  2. Click Servers.

  3. In the list of servers, click the SLES 9 managed device, then click the Settings tab.

  4. Click System Variables, then click Override settings.

  5. In the System Variables panel, click Add, then fill in the following details:

    • Name: source_path

    • Value: /etc/zmd

  6. Click OK.

  7. Click Apply, then click OK.

Creating the Remote Execute Policy and Assigning It to the Managed Devices

  1. In 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.

  4. Fill in the Policy Name, Folder, and Description fields. For more information, see Step 4 in Section 16.6, Remote Execute Policy.

  5. Click Next.

  6. In the Remote Execute Policy page, configure the following settings:

    • Executable Type: Select Binary.

    • Maximum waiting time: Select Wait till the program completes the execution.

    • Executable file name: /bin/cp.

    • Executable file parameters: ${source_path}/deviceid /tmp.

  7. Click Next to display the Summary page.

  8. Review the information.

  9. Click Next to display the Policy Assignment page, then assign the policy to SLES 9 and SLES 10 devices

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

  11. Click Next to display the Policy Groups page. For more information, see Step 12 in Section 16.6, Remote Execute Policy.

  12. Click Next to display the Finish page.

  13. Click Finish.

After the policy is applied on the managed devices, a copy of deviceid is created in the /tmp directory.