Scripts are autodetected on a server, as are other applications and services on the machine. Scripts can be configured and managed like any other resource, which means that JBoss ON allows you to both define configuration settings for and set up operations to run the scripts in inventory.
Whether a script is added or detected, there are only two configuration areas for the inventory entry: the path to the script, which places the script within the hierarchy, and any environment variables that should be set with the script.
These environment variables can be added and edited even after the script is imported:
Before setting environment variables in the JBoss ON configuration, make sure that the environment on the resource is already configured properly.
Click the Inventory tab in the top menu.
Search for the script resource.
Open the Configuration tab for the script resource.
Click the plus sign (+) to add an environment variable.
Enter the environment variable. Each new environment variable has the format name=value; and is added on a new line.
If the variable's value contains properties with the syntax
%propertyName%, then JBoss ON interprets the value as the current values of the corresponding properties from the script's parent resource's connection properties.
After resetting an environment variable, restart the JBoss ON agent to propagate the changes. If the agent isn't restarted, new variables will not be propagated to the resource and will not resolve when the script is next executed, even if the configuration is correct.
Add the line
@echo off in Windows scripts to prevent echoing the executed commands along with the execution results.