An action script defines one or more actions to start, stop, check, or clean resources. The agent framework invokes these actions without the C/C++ actions. Using action scripts, you can build an agent that contains the C/C++ entry points and the script entry points. If all of the actions are defined in the action script, then you can use the script agent to invoke the actions defined in any action scripts.
Before invoking the action defined in the action script, the agent framework exports all the necessary attributes from the resource profile to the environment. Action scripts can log messages to the stdout/stderr
, and the agent framework prints those messages in the agent logs. However, action scripts can use special tags to send the progress, warning, or error messages to the crs*
client tools by prefixing one of the following tags to the messages printed to stdout/stderr
:
CRS_WARNING: CRS_ERROR: CRS_PROGRESS:
The agent framework strips out the prefixed tag when it sends the final message to the crs*
clients.
Resource attributes can be accessed from within an action script as environment variables prefixed with _CRS_
. For example, the START_TIMEOUT
attribute becomes an environment variable named _CRS_START_TIMEOUT
.
See Also:
"crsctl start resource" and "crsctl stop resource" for more information about using the -env
option as a way to override attribute values for a single start or stop action, respectively
Example B-3 for an example of an action script for an agent