Deploying custom agents on virtual machines running Linux
This section describes how to deploy custom agents in a virtual machine running Linux in a VCS for ESX environment.
To deploy a custom agent in a virtual machine running Linux
-
Build the custom agent.
See Building a custom agent on UNIX.
Symantec recommends the following naming convention for the agent binary:
resource_typeAgent
-
Place the agent in the following directory:
/opt/VRTSvcs/bin/resource_type.
An example for the agent binary for the CustomApp agent is:
/opt/VRTSvcs/bin/CustomApp/CustomAppAgent
-
Implement the Monitor and Clean entry points for the agent. Agents running in a virtual machine do not use the Online and Offline entry points.
-
If you implement the entry points using scripts, name the scripts
online
and clean
.
-
Build the Clean script such that it returns 0.
#!/bin/sh
exit 0;
-
Place the script files in the following directory:
/opt/VRTSvcs/bin/resource_type/
For example:
/opt/VRTSvcs/bin/CustomApp/monitor
/opt/VRTSvcs/bin/CustomApp/clean
-
The agent requires a resource type definition file. Name the resource type definition file using following the convention
resource_typeTypes.cf.
For example:
CustomAppTypes.cf
-
Populate the types file with the following information:
-
Create an XML file for the agent. Name the file resource_type.xml.
SeeCreating the type definition file for a custom agent.
-
Copy the existing types. cf file (/etc/VRTSvcs/conf/config/types.cf) to a different location on the virtual machine.
-
Edit the copied file to add the types information about the custom agent. Copy the contents of the file CustomAppTypes.cf to the types.cf file.
-
Verify the syntax of the updated file.
-
Copy the updated types.cf file to a directory (config_directory) on an ESX Server that is part of the VCS cluster.
-
Create a main.cf file in the same directory. In the main.cf file, add the following line:
include "types.cf"
-
Run the following command:
hacf -verify config_directory
The variable config_directory refers the directory containing the types.cf file and the main.cf file.
No error message and a return value of zero indicates that the syntax is valid.
-
If the syntax is valid, replace the current types.cf on the virtual machine with the updated file.
-
Before configuring the agent to start monitoring the application:
-
Make sure the application is running.
-
Make sure the application is configured to automatically start when the virtual machine starts.
-
In the virtual machine, navigate to /opt/VRTSvcs/bin.
-
Start the configuration utility:
./vcsag_config.pl
-
Follow the prompts to complete the agent configuration.
The utility restarts the VCS agent management daemon to start monitoring the application.
The utility also configures a resource of type GuestOSApp on the ESX Server. The resource listens for updates on the state of application running inside the virtual machine.