Print Download PDF Send Feedback

Previous

Next

Example 2 - Run a Script to Get Information

This example Deployment Plan performs these actions on all applicable Security Gateways:

  1. Runs the script getInformation.sh, found on the Management Server in the /home/admin/ directory.

    This script:

    1. Collects the desired information on the remote Security Gateway (such as the installed policy, the installed license, and so on)
    2. Saves its log to the /home/admin/log.txt file on the remote Security Gateway

    Example script:

    #!/bin/bash

    LOG_FILE="/home/admin/log.txt"

    cpstat -f policy >> $LOG_FILE

    cplic print -x >> $LOG_FILE

    exit 0

  2. Pulls the file /home/admin/log.txt from the remote Security Gateway and saves it in the /opt/CPcdt/information/ directory on the Management Server.

Example XML file for this Deployment Plan:

<?xml version="1.0" encoding="UTF-8"?>

<CDT_Deployment_Plan>

<plan_settings>

<name value="Get information from the gateways" />

<description value="Example deployment plan - run a script to get information" />

<update_cpuse value="true" />

</plan_settings>

 

<!-- The script 'getInformation.sh' redirects its output to the '/home/admin/log.txt' -->

<execute_script path="/home/admin/getInformation.sh" />

<pull_file remote_path="/home/admin/log.txt" local_dir="/opt/CPcdt/information/" />

</CDT_Deployment_Plan>