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
Example: info entry point implementation in C++
Set the VCSAgValidateAndSetEntryPoint() parameter to the name of the entry point's function (res_info).
Allocate the info output buffer in the entry point as shown in the example below. The buffer can be any size (the example uses 80), but the agent framework truncates it to 2048 bytes. For the optional name-value pairs, name and value each have a limit of 4096 bytes (the example uses 15).
Example V51 entry point:
extern "C" unsigned int res_info(const char *res_name, VCSAgResInfoOp resinfo_op, void **attr_val, char **info_output, char ***opt_update_args, char ***opt_add_args) { struct stat stat_buf; int I; char **args = NULL; char *out = new char [80]; *info_output = out; VCSAgSnprintf(out, 80,"Output of info entry point - updates the \"Msg\" key in ResourceInfo attribute"); // Use the stat system call on the file to get its // information The attr_val array will look like "PathName" // "1" "<pathname value>" ... Assuming that PathName is the // first attribute in the attr_val array, the value // of this attribute will be in index 2 of this attr_val // array if (attr_val[2]) { if ((strlen((CHAR *)(attr_val[2])) != 0) && (stat((CHAR *)(attr_val[2]), &stat_buf) == 0)) { if (resinfo_op == VCSAgResInfoAdd) { // Add and initialize all the static and // dynamic keys in the ResourceInfo attribute args = new char * [7]; for (I = 0; I < 6; I++) { args[i] = new char [15]; } // All the static information - file owner // and group VCSAgSnprintf(args[0], 15, "%s", "Owner"); VCSAgSnprintf(args[1], 15, "%d", stat_buf.st_uid); VCSAgSnprintf(args[2], 15, "%s", "Group"); VCSAgSnprintf(args[3], 15, "%d", stat_buf.st_gid); // Initialize the dynamic information for the file VCSAgSnprintf(args[4], 15, "%s", "FileSize"); VCSAgSnprintf(args[5], 15, "%d", stat_buf.st_size); args[6] = NULL; *opt_add_args = args; } else { // Simply update the dynamic keys in the // ResourceInfo attribute. In this case, the // dynamic info on the file args = new char * [3]; for (I = 0; I < 2; I++) { args[i] = new char [15]; } VCSAgSnprintf(args[0], 15, "%s", "FileSize"); VCSAgSnprintf(args[1], 15, "%d", stat_buf.st_size); args[2] = NULL; *opt_update_args = args; } } else { // Set the output to indicate the error VCSAgSnprintf(out, 80, "Stat on the file %s failed", attr_val[2]); return 1; } } else { // Set the output to indicate the error VCSAgSnprintf(out, 80, "Error in arglist values passed to the info entry point"); return 1; } // Successful completion of the info entry point return 0; } // End of entry point definition