When an agent starts, it uses the routine named VCSAgStartup
to initialize the agent's data structures.
If you implement all of the agent's entry points as scripts:
On UNIX, use the Script50Agent binary.
The built-in implementation of VCSAgStartup() in these binaries initializes the agent's data structures such that it causes the agent to look for and execute the scripts for the entry points.
See Creating entry points in scripts.
If you develop an agent with at least one entry point implemented in C++, you must implement the function VCSAgStartup() and use the required C++ primitives to register the C++ entry point with the agent framework.
When using C++ to implement an entry point, use the VCSAgInit API and specify the entry point and the function name. In the following example, the function my_shutdown
is defined as the Shutdown entry point.
VCSAG_LOG_INIT("VCSAgStartup");
VCSAgInitEntryPointStruct(V50);
VCSAgValidateAndSetEntryPoint(VCSAgEPShutdown, my_shutdown);
Note that the monitor
entry point, which is mandatory, is assigned a NULL
value, indicating it is implemented using scripts. If you are using a script entry point, or if you are not implementing an optional entry point, set the corresponding field to NULL
.
For an entry point whose field is set to NULL
, the agent automatically looks for the correct script to execute:
$
VCS_HOME/bin/resource_type/<entry_point>
Note For Windows, the extension (.extn) assumes the value "exe" for executable programs, "sh" for shell scripts compatible with MKS Toolkit, "bat" or "cmd" for batch files, "pl" for Perl scripts, "js" for Javascript, or "vbs" for Visual Basic scripts.