Using the AgentServer utility to test agents
The AgentServer
utility enables you to test agents without running the VCS engine process. The utility is part of the product package and is installed in the directory
Windows: %VCS_HOME%\bin
Run the AgentServer utility on any node when theengine process is not running.
To start AgentServer and test the FileOnOff agent (Windows)
-
Type the following command to start AgentServer:
%VCS_HOME%\bin\AgentServer
AgentServer must monitor a TCP port for messages from the agents. This port number can be configured by setting vcstest to the selected port number in the file C:\WINNT\system32\drivers\etc\services. If vcstest is not specified, AgentServer uses the default value 14142.
-
Start the agent for the resource type:
>startagent FileOnOff %VCS_HOME%\bin\VCSAgDriver.exe
. You will receive the following messages:
Agent (FileOnOff) has connected.
Agent (FileOnOff) is ready to accept commands.
-
Review the sample configuration:
types.cf:
type FileOnOff (
str PathName
static str ArgList[] = { PathName }
NameRule = resource.PathName
)
main.cf:
...
group ga (
...
)
FileOnOff file1 (
Enabled = 1
PathName = "C:\\VRTSvcsfile001"
)
-
Refer to the types.xml and main.xml configuration files when testing the FileOnOff agent. In the next step, the sample configuration is set up using AgentServer commands.
-
Complete step n through step n to pass this sample configuration to the agent.
-
Add a type:
>addtype FileOnOff FileOnOff
-
Add attributes of the type:
>addattr FileOnOff FileOnOff PathName str ""
>addattr FileOnOff FileOnOff Enabled int 0
-
Add the static attributes to the FileOnOff resource type:
>addstaticattr FileOnOff FileOnOff ArgList vector PathName
-
Add the LogLevel attribute to see the debug messages from the
agent:
>addstaticattr FileOnOff FileOnOff LogLevel str info
-
Add a resource:
>addres FileOnOff file1 FileOnOff
-
Set the resource attributes:
>modifyres FileOnOff file1 PathName str
C:\\VRTSvcs
file001
>modifyres FileOnOff file1 Enabled int 1
-
After adding and modifying resources, type the following command to obtain the status of a resource:
>proberes FileOnOff file1
This calls the monitor entry point of the FileOnOff agent.
You will receive the following messages indicating the resource status:
Resource(file1) is OFFLINE
Resource(file1) confidence level is 0
-
To bring a resource online:
>onlineres FileOnOff file1
This calls the online entry point of the FileOnOff agent. The following message is displayed when file1 is brought online:
Resource(file1) is ONLINE
Resource(file1) confidence level is 100
-
To take a resource offline:
>offlineres FileOnOff file1
This calls the offline entry point of the FileOnOff agent. A status message similar to the example in step n is displayed when file1 is taken offline.
-
View the list of agents started by the AgentServer process:
>print
Output resembles:
Following Agents are started:
FileOnOff
-
Stop the agent:
>stopagent FileOnOff
-
Exit from the AgentServer:
>quit