Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Control the Execution of Commit Scripts in the QFabric System

This document describes the tasks that affect the way commit scripts are executed. In the QFabric system, commit scripts are stored in the in the /pbdata/mgd_shared/partition-ip/var/db/scripts/commit directory that is shared among Director devices in a Director group.

To determine which commit scripts are currently enabled on the QFabric system, use the show command to display the files included at the [edit system scripts commit] hierarchy level. To ensure that the enabled files are on the device, list the contents of the /pbdata/mgd_shared/partition-ip/var/db/scripts/commit directory using the file list operational mode command.

See the following tasks:

Enabling Commit Scripts to Execute

The commit operation requires that all scripts be included in configuration at the [edit system scripts commit file] hierarchy level for all QFabric Director devices.

If you need to temporarily remove a script from a commit operation but do not want to remove it from the configuration permanently, you may configure the optional statement at the [edit system scripts commit file filename] hierarchy level to enable the commit operation to succeed even if a script is missing from the commit script directory.

CAUTION:

When you include the optional statement at the [edit system scripts commit file filename] hierarchy level, no error message is generated during the commit operation if the file does not exist. As a result, you might not be aware that a script has not been executed as expected.

The filename of a commit script written in SLAX or Python must include the .slax or .py file extension, respectively, for the script to be executed.

To enable a commit script to execute during a commit operation:

  1. Ensure that the commit script is located in the correct directory: /pbdata/mgd_shared/partition-ip/var/db/scripts/commit directory on the Director device.
  2. Configure the commit script.
  3. Commit the configuration.

Removing Commit Scripts from the Configuration

You can prevent a commit script from executing during a commit operation by removing the script’s filename from the [edit system scripts commit] hierarchy in the configuration.

Note:

You can also deactivate a script using the deactivate statement instead of removing it from the configuration. Deactivated scripts may be reactivated later.

To prevent a commit script from executing during a commit operation:

  1. Delete the commit script filename from the [edit system scripts commit] hierarchy level in the configuration.
  2. Commit the configuration.
  3. (Optional) Remove the commit script from the /pbdata/mgd_shared/ directory on the Director device.
    Best Practice:

    Although removing the commit script is not necessary, we recommend deleting unused files from the system.

Deactivating Commit Scripts

Deactivating a commit script results in its being marked as inactive in the configuration. The script is not executed during the commit operation, but you can reactivate the script by using the activate statement.

To deactivate the commit script:

  1. Deactivate the script.
  2. Commit your changes.
  3. Verify that the commit script is deactivated.

Activating Inactive Commit Scripts

Deactivating a commit script results in its being marked as inactive in the configuration and is therefore not executed during the commit operation.

To activate an inactive commit script:

  1. Activate the script.
  2. Commit your changes.