3.1.8.2. Agent Scripts
An agent script will be executed on the hosts that match a certain policy. To create an agent script, go to ON CMDB > Agent > Agent Scripts. You will see the following configuration view:

All the scripts created to be running on an Agent are in this view. We can Add new, Edit, or Delete a script. To create an Agent script, we need the following information:
Type: You can select the language of the script.

There are three options: bash language for Linux and macOS, and powershell language.
Key: You can add the name of the script.
Processes that will execute the script: You can select the processes that will execute the script.

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 we have selected.

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.