3.2.2.5.3. Scripts

An Agent script will be executed on the hosts that match a certain policy. All scripts created to be running on an Agent will be displayed in this view.

../../../../_images/agent_scripts.png


3.2.2.5.3.1. Creating a new script

To create a new script, click on the Create new button. It will display a window where you can configure the following properties:

../../../../_images/new_script.png


  • Type: You can select the language of the script from three options: bash language for Linux and macOS, and powershell language.

  • Name: Define the script name. It cannot have blank spaces. Use only numbers or letters.

  • Processes that will execute the script: You can select the processes that will execute the script:

    • Execute script on process a scan requested by user

    • Execute script on process a scan

    • Execute script on process a full scan

    • Execute script on process an event of Product changed

    • Execute script on process an event of Firewall changed

    • Execute script on process an event of Security Center changed

    • Execute script on process an event of Network changed

    • Execute script on process an event of User session changed

    • Execute script on process an event of Agent service stopped

  • Impersonate: You can choose whether the script will be executed by the system or only when the user is logged in when using the PowerShell script type. For the Bash type, this option is disabled.

  • Script: Code with the language you have selected.

../../../../_images/script_example.png


For example, here there is a script that searches a file called LogDir in the path entered. The -ErrorAction Ignore is important to avoid problems when the file does not exist.

Click on Confirm to save your configurations and you will see your new Agent script displayed in the main table.

../../../../_images/script_example2.png


Hover over the icons locate under the column processes that will execute the script to see the event they represent.

Click on the eye icon to see the script.

../../../../_images/eye_script.png


By clicking on the three-dot icon located at the end of the row, you can edit or delete the script.