Syntax for C++ monitor

VCSAgResState

res_monitor(const char *res_name, void **attr_val,int *conf_level);

You may select any name for the function.

The parameter conf_level is an output parameter. The return value, which indicates the resource status, must be a defined VCSAgResState value.

See Return values for entry points.

For example:

#include "VCSAgApi.h"

VCSAgResState

res_monitor(const char *res_name, void **attr_val, int *conf_level)

{

// Code to determine the state of a resource.

VCSAgResState res_state = ...

if (res_state == VCSAgResOnline) {

// Determine the confidence level (0 to 100).

*conf_level = ...

}

else {

*conf_level = 0;

}

return res_state;

}

void VCSAgStartup()

{

VCSAG_LOG_INIT("VCSAgStartup");

VCSAgSetLogCategory(10051);

VCSAgInitEntryPointStruct(V50);

VCSAgValidateAndSetEntryPoint(VCSAgEPMonitor, res_monitor);

}