Navigation: Working with EventSentry > Embedded Scripts |
Embedded scripts allow you to embed scripts of any kind (command line scripts, visual basic scripts, perl scripts, etc.) inside the EventSentry configuration, so that the scripts themselves do not have to be maintained on to the target machines, making it easier to maintain environments that utilize scripts. Embedded scripts can be used with the Application Scheduler and Process action.
Embedded scripts themselves are stored in the registry, and can be configured at Tools -> Embedded Scripts.
Using Embedded Scripts To use an embedded script, pre-pend the file name with the @ symbol in an application schedule or process action. For example, if your script is named LaunchUpload.cmd, then specify @LaunchUpload.cmd. Fields that support embedded scripts feature a pull-down menu that lets you select from any of the configured scripts.
Launch Folder This is the directory where the scripts will reside on disk and executed from. The default setting is %SYSTEMROOT%\system32\eventsentry.scripts, and can be customized by changing the Launch Folder.
Embedded scripts that are assigned to a particular host will be created in the launch folder of that computer when the agent is started. If a script is not assigned, meaning that is neither used by an application schedule nor a process action, then it will not be created in the launch folder. Scripts in the launch folder will be deleted when the agent is stopped.
Restrict Permissions The launch folder inherits its permissions from the parent folder by default, which will differ depending on the OS. To ensure that only the agent has access to the script files in the launch folder, you can check the Restrict Permissions check box. This will ensure that only the account the EventSentry service is running under (LocalSystem by default) will have (NTFS) permission to access the file(s).
Adding a Script To create a new embedded script, click the Add button, specify a name for the script and hit enter. The name of the script is important, as this will be the name of the file in the launch folder. As such, it is also highly recommended that you specify a valid file extension, a requirement when no interpreter is specified.
You can specify the script content in the Script Content text area, which supports scripts with up to 16384 characters. Scripts can either be edited in the script content field directly, pasted from the clipboard (paste button) or loaded from a file (Load button).
Managing Script Content After selecting a script in the File name list box, you can either edit the actual script directly in the Script Content text area, copy & paste the content to/from the clipboard, or load/save the script to/from a file.
Interpreter An interpreter is only necessary when the file extension that is used for the file cannot be mapped to an executable by the OS. For example, if you are adding a PERL script, then you can specify perl.exe as the script interpreter.
Deleting a Script To delete a script, simply select it from the File Name list and click Delete. Keep in mind that any application schedules and/or process actions referencing that embedded script will no longer work since the script does no longer exist.
|