InfoScale™ 9.0 Cluster Server Agent Developer's Guide - 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
Agent application logging macros for C++ entry points
You can use the macro VCSAG_LOG_MSG within C++ agent entry points to log all messages ranging in severity from CRITICAL to INFORMATION to the agent log file. Use the VCSAG_CONSOLE_LOG_MSG macro to send messages to the HAD log. Where the messages are of CRITICAL or ERROR severity, the message is also logged to the console.
The following table describes the argument fields for the application logging macros:
sev | Severity of the message from the application. The values of sev are macros VCS_CRITICAL, VCS_ERROR, VCS_WARNING, VCS_NOTICE, and VCS INFORMATION; see Severity arguments for C++ macros. |
msgid | The 16-bit integer message ID. |
flags | Default flags (0) prints UMI, NEWLINE. A macro, VCS_DEFAULT_FLAGS, represents the default value for the flags. |
fmt | A formatted string containing formatting specifier symbols. For example: "Resource could not be brought down because the attempt to remove the file (%s) failed with error (%d)" |
variable_args | Variable number (as many as 6) of type char, char *, or integer |
In the following example, the macros are used to log an error message to the agent log and to the console:
. . VCSAG_LOG_MSG(VCS_ERROR, 14002, VCS_DEFAULT_FLAGS, "Resource could not be brought down because the attempt to remove the file(%s) failed with error(%d)", (CHAR *)(*attr_val), errno); VCSAG_CONSOLE_LOG_MSG(VCS_ERROR, 14002, VCS_DEFAULT_FLAGS, "Resource could not be brought down because, the attempt to remove the file(%s) failed with error(%d)", (CHAR *)(*attr_val), errno);