Please enter search query.
Search <book_title>...
InfoScale™ 9.0 Cluster Server Agent Developer's Guide - AIX, Linux, Solaris, Windows
Last Published:
2025-04-13
Product(s):
InfoScale & Storage Foundation (9.0)
Platform: AIX,Linux,Solaris,Windows
- Introduction
- Agent entry point overview
- About agent entry points
- Agent entry points described
- About the action entry point
- About the info entry point
- Considerations for using C++ or script entry points
- About the agent information file
- About the ArgList and ArgListValues attributes
- Creating entry points in C++
- About creating entry points in C++
- Syntax for C++ entry points
- Agent framework primitives
- Agent Framework primitives for container support
- Creating entry points in scripts
- About creating entry points in scripts
- Syntax for script entry points
- Agent framework primitives
- VCSAG_GET_ATTR_VALUE
- Agent Framework primitives with container support
- Example script entry points
- Logging agent messages
- Building a custom agent
- Building a script based IMF-aware custom agent
- Creating XML file required for AMF plugins to do resource registration for online and offline state monitoring
- Testing agents
- Static type attributes
- About static attributes
- Static type attribute definitions
- AdvDbg
- ArgList
- State transition diagram
- Internationalized messages
- Troubleshooting VCS resource's unexpected behavior using First Failure Data Capture (FFDC)
- Appendix A. Using pre-5.0 VCS agents
Syntax for C++ attr_changed
void res_attr_changed(const char *res_name, const char *changed_res_name, const char *changed_attr_name, void **new_val);
The parameter new_val contains the attribute's new value. The encoding of new_val is similar to the encoding described under About the ArgList and ArgListValues attributes.
See 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.
For example:
#include "VCSAgApi.h" void res_attr_changed(const char *res_name, const char *changed_res_name, const char *changed_attr_name, void **new_val) { // 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 // to be a string. const char *foo_val = (char *)new_val[0]; // Implement the action. ... } // 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 // assumed to be an integer. int sizeval = atoi((char *)new_val[0]); // Implement the action. ... } } void VCSAgStartup() { VCSAG_LOG_INIT("VCSAgStartup"); VCSAgSetLogCategory(10051); VCSAgInitEntryPointStruct(V51); VCSAgValidateAndSetEntryPoint(VCSAgEPAttrChanged, res_attr_changed);}