Citrix

Produktdokumentation



Ganzes Dokument herunterladen

Configuring Custom Tasks

Dec. 18, 2015

Custom tasks are user-defined configuration tasks that you can add in Command Center to perform a defined set of operations on the managed devices. These tasks may contain a heterogeneous set of commands, such as CLI commands, SHELL, or Secure File Transfer Protocol (SFTP), that you can execute on a single device or a set of devices grouped together in a device list.

Use the following procedures for configuring custom tasks:

Adding Custom Tasks

Updated: 2015-05-26

You can add custom tasks using one of the following methods:

  • Define new commands: Create a new task by defining task variables and commands. For more information see Adding New Custom Tasks.
  • Import from command file: Create a task from a command file. A command file is a text file containing a list of commands that constitute a task; the content could be a snippet of the ns.conf file. Each command may be a NetScaler CLI, Shell, or FTP command. You must have the command file present on the Command Center server or on the local file system. For more information see Adding Custom Tasks from Command Files.
  • Import from task file: Create a task from an existing task file. Use this option to enhance or modify an existing task. For example, you can create a new task from a built-in task or import a task already created on another Command Center server. You must have the task file present on the Command Center server or on the local file system. For more information see Adding Custom Tasks by Importing from Task Files.

With custom tasks, you have the option to configure task operations in the following ways:

Execute Sequentially: Execute a task on a set of devices, one device at a time. If task execution fails on any device, it does not continue on the remaining devices . By default, if you do not select this option, the task will be executed in parallel.

Execute on Inaccessible System(s): If the selected devices or the device list include any inaccessible devices (discovery failed devices), the task is executed on these devices as well as on the others.
Enable Role-Based Authorization (RBA): Allow task execution by authorized users only. Specify the user names and passwords of the authorized users. RBA works in the following scenarios:
  • If you enable RBA globally on the Admin tab, regardless of the task-level setting, a custom task is executed only after you provide RBA credentials.
  • If you do not enable RBA globally, task execution prompts for RBA credentials based on the task-level settings.
  • Save Configuration on Success: After successful execution, the configuration is saved on the device.
If at any point of time, the task witnesses a command failure you can choose to perform any of the following actions:
  • Stop Further Execution:

    If a command fails, Command Center stops executing the remaining commands. If you have selected the Execute Sequentially option and the command fails on one of the devices, execution does not proceed on the remaining devices.

    If you have not selected the Execute Sequentially option , task execution continues on the remaining devices even if the command fails on one of the devices.

  • Ignore and Continue:

    If a command fails, Command Center ignores the failed command and continues executing the remaining commands on the device . However, if you have selected the Execute Sequentially option and the command fails and continues executing the remaining commands, execution does not proceed on the remaining devices.

    If you have not selected the Execute Sequentially option , and the command fails and continues executing the remaining commands, task execution does not proceed on the remaining devices.

  • Rollback Successful Commands:

    Generate rollback commands at run time by fetching these commands based on the version of the device. If command execution within a task fails, the entire task is rolled back.

    Device specific rollback commands have precedence over the user defined rollback commands.

    When executing tasks, click Preview to display the system-generated rollback commands .

Note: Rollback Successful Commands is applicable only for NetScaler ADCs.

If you configure a task to support the auto rollback feature, the preview screen displays the actual executable commands and the corresponding rollback commands in a tabular format for devices selected in the device list. However, if you configure a task to not support the auto rollback feature, the preview screen displays the actual commands sequentially.

You may encounter errors in the following scenarios:
  • When the auto rollback feature is not supported for a particular device version.
  • When there are no CLI commands in a task.

Adding New Custom Tasks

Updated: 2014-04-15

You can create a custom task form start by defining commands and task variables.

To add new custom tasks

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, click Add.
  3. Under Custom Task Add Options, click Define new commands, and then click Next.
  4. Under Add custom task, click either of the following:
    • Define new commands— Create a new task by defining task variables and commands.
    • Import from command file— In the Choose File dialog box, select the command file you want to use, click Open, and then click Next.
    • Import from task file— n the Choose File dialog box, select the task file you want to use, click Open, and then click Next.
  5. Specify the Task Name, Description, Category, Device Family, and then select one or more of the following check boxes:
    • Execute Sequentially: Specifies whether to execute the task on the devices in a sequential manner.
    • Execute on Inaccessible system(s) also: Specifies whether to execute the task on inaccessible devices.
    • Enable RBA: Specifies whether the user should provide user credentials before task execution.
    • Enable Auto Rollback: Specifies whether rollback commands are generated implicitly during runtime. When you select this check box, you do not need to manually type rollback commands when adding actual commands in step 8.
  6. Click Add Command.
  7. In the Command dialog box, in Command, type the command you want to execute. This must be the actual command that you need to execute on the managed device. The commands you define here may use the task variables. The following is a sample command for creating and binding a filter policy:
    add filter policy $policyname$ -rule $expression$ 
     -$actionType$ $actionname$ bind filter global $policyname$
    Note: You must enclose task variables between the $ symbols.
  8. In Protocol, select the protocol you want to associate with the command.
  9. In Rollback, type the rollback command to use if the actual command fails.
    Note: If you have selected the Enable Auto Rollback option in step 7, you do not need to type the rollback command here.
  10. Click OK.
  11. In the Add custom task, click Add Task Variable.
  12. In the Variable dialog box, specify the variable information, and then click OK.

Adding Custom Tasks from Command Files

Updated: 2014-04-15

You can add a custom task from a command file that contains the commands to be executed on the devices.

A command file is a text file containing a list of commands that constitute a task; the content could be a snippet of the ns.conf file. Each command may be a NetScaler CLI, Shell, or FTP command. You must have the command file present on the Command Center server or on your local system.

To add custom tasks from command files

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, click Add.
  3. Under Custom Task Add Options, select either of the following click Next:
    • Define new commands— Create a new task by defining task variables and commands.
    • Import from command file— In the Choose File dialog box, select the command file you want to use, click Open, and then click Next.
    • Import from task file— n the Choose File dialog box, select the task file you want to use, click Open, and then click Next.
  4. Under Add Custom Task, specify the task name and description, category, device family, and then select one or more of the following check boxes:
    • Execute Sequentially: Specifies whether to execute the task on the devices in a sequential manner.
    • Execute on Inaccessible system(s) also: Specifies whether to execute the task on inaccessible devices also.
    • Enable RBA: Specifies whether the user should provide user credentials before task execution.
    • Enable Auto Rollback: Specifies whether rollback commands are generated implicitly during runtime.
  5. In the Add custom task, click Add Task Variable.
  6. In the Variable dialog box, specify the variable information, and then click OK.

Adding Custom Tasks by Importing from Task Files

Updated: 2014-04-15

You can add a custom task from an existing task file. You can also enhance or modify an existing task to create a new task. For example, you can create a new task from a built-in task, or import a task already created on another Command Center server. You must have the task file present on the Command Center server or on your local system.

To add custom tasks by importing from task files

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, click Add.
  3. Under Custom Task Add Options, select either of the following and click Next:
    • Define new commands— Create a new task by defining task variables and commands.
    • Import from command file— In the Choose File dialog box, select the command file you want to use, click Open, and then click Next.
    • Import from task file— n the Choose File dialog box, select the task file you want to use, click Open, and then click Next.
  4. Under Add Custom Task, select one or more of the following check boxes:
    • Execute Sequentially: Specifies whether to execute the task on the devices in a sequential manner.
    • Execute on Inaccessible system(s) also: Specifies whether to execute the task on inaccessible devices.
    • Enable RBA: Specifies whether the user should provide user credentials before task execution.
    • Enable Auto Rollback: Specifies whether rollback commands are generated implicitly during runtime.
  5. In the Add custom task, click Add Task Variable.
  6. In the Variable dialog box, specify the variable information, and then click OK.

Executing Custom Tasks

Updated: 2014-04-15

You can execute a custom task on multiple devices at the same time. You can either select devices individually or select a device list for the tasks. You can execute the same task several times on different devices or device lists. You can also preview a task (the commands and rollback commands) before executing it.

To execute custom tasks

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, select the custom task you want to execute, and from the Action drop-down list, click Execute

Viewing the Execution Log for Specific Custom Tasks

Updated: 2014-04-15

After executing a task, you can view the following execution details of that task instantly or at a later time.

To view the execution log for specific custom tasks

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, select the custom task whose execution details you want to view, and from the Action drop-down list, select Execution Log, and follow the wizard instructions.
  3. Under Execution Log, you can view the following:
    • Task Name: Specifies the task name.
    • Device Name: Specifies the IP address of the device on which the task is executed.
    • Start Time: Specifies the time when the task started.
    • End Time: Specifies the time when the task ended.
    • CC User: Specifies the Command Center user who initiated the task.
    • Device User: Specifies the NetScaler or CloudBridge user who initiated the task.
    • Status: Specifies the completion status of the task, such as Success, Failed, and Queued.
    • Annotation: Specifies a message that is annotated when executing the task.

Note: You can also view an execution log for all executed custom tasks by clicking Execution Log under Configuration in the left pane.

Scheduling Custom Tasks

Updated: 2014-04-16

You can schedule custom tasks to execute at a later period or recur at regular intervals. For example, you can schedule tasks to be executed at specific hours daily, at specific hours on specific days of the week, and at specific hours on specific days of the month.

To schedule custom tasks

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, select the custom task you want to execute, and from the Action drop-down list click Schedule, and follow the prompts in the wizard. Alternately, right-click the custom task, click Schedule, and then follow the prompts in the wizard.

Note: To view scheduled custom tasks, in the right pane, under Custom Tasks, on the bottom bar, click Scheduled Tasks. You can stop, resume, or remove a scheduled custom task.

Exporting Custom Tasks

Updated: 2014-04-16

You can save the custom tasks in XML format on the Command Center server. This XML file, also known as task file, can be used to create a new custom task in the existing server, or can be copied to another Command Center server.

Note: The location of the exported file is CC_Home\provisioningtemplates\exportedtemplates.

To export custom tasks

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, select the task you want to export, and from the Action drop-down list select Export.
  3. Under Export Task, in Name, type a name for the task file, and then click OK. A message appears confirming that the selected task is successfully exported.

Modifying Custom Tasks

Updated: 2014-04-18

You can modify the values of the fields in a custom task.

To modify custom tasks

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, select the task you want to export, and from the Action drop-down list, click Edit.
  3. Under Modify custom task, make changes to the fields you want to modify, and then click OK.

Deleting Custom Tasks

Updated: 2014-04-15

If you do not want to use a custom task again, you can delete it.

To delete custom tasks

  1. On the Configuration tab, in the left pane, under Configuration, click Custom Tasks.
  2. In the right pane, under Custom Tasks, select the task you want to export, and then click Delete.
  3. In the confirmation message box, click OK.
Back to Top