res_attr_changed(const char *res_name, const char
const char *changed_attr_name,
The parameter new_val
contains the attribute's new value. The encoding of new_val
is similar to the encoding of the About the ArgList and ArgListValues attributes.
You may select any name for the function.
Set the VCSAgValidateAndSetEntryPoint() parameter to the name of the entry point's function.
In the following example, the function res_attr_changed is defined as the attr_changed entry point.
Note This entry point is called only if you register for change notification using the primitive VCSAgRegister, or the agent parameter RegList (see RegList).
res_attr_changed(const char *res_name,
const char *changed_attr_name,
// When the value of attribute Foo changes, take some action.
if ((strcmp(res_name, changed_res_name) == 0) &&
(strcmp(changed_attr_name, "Foo") == 0)) {
// Extract the new value of Foo. Here, it is assumed
const char *foo_val = (char *)new_val[0];
// Resource Ora1 managed by this agent needs to
// take some action when the Size attribute of
// the resource Disk1 is changed.
if ((strcmp(res_name, "Ora1") == 0) &&
(strcmp(changed_attr_name, "Size") == 0) &&
(strcmp(changed_res_name, "Disk1") == 0)) {
// Extract the new value of Size. Here, it is
int sizeval = atoi((char *)new_val[0]);
VCSAG_LOG_INIT("VCSAgStartup");
VCSAgInitEntryPointStruct(V50);
VCSAgValidateAndSetEntryPoint(VCSAgEPMonitor, res_monitor);
VCSAgValidateAndSetEntryPoint(VCSAgEPOnline, res_online);
VCSAgValidateAndSetEntryPoint(VCSAgEPOffline, res_offline);