Veritas™ Cluster Server Agent Developer's Guide

Article:DOC5232  |  Created: 2012-01-27  |  Updated: 2012-02-20  |  Article URL http://www.symantec.com/docs/DOC5232
Article Type
Documentation

Product(s)

Environment

Description



Veritas™ Cluster Server Agent Developer's Guide

Contents

1. Introduction
About VCS agents
What's new in this release
How agents work
About the agent framework
About intelligent monitoring framework (IMF)
Resource type definitions
About agent functions (entry points)
About on-off, on-only, and persistent resources
About attributes
About intentional offline of applications
About developing an agent
Considerations for the application
High-level overview of the agent development process
2. Agent entry point overview
About agent entry points
Supported entry points
How the agent framework interacts with entry points
Agent entry points described
About the open entry point
About the monitor entry point
About the online entry point
About the offline entry point
About the clean entry point
About the action entry point
About the info entry point
About the attr_changed entry point
About the close entry point
About the shutdown entry point
About the imf_init entry point
About the imf_register entry point
About the imf_getnotification point
Return values for entry points
Considerations for using C++ or script entry points
About the VCSAgStartup routine
About the agent information file
Example agent information file (UNIX)
Implementing the agent XML information file
About the ArgList and ArgListValues attributes
ArgListValues attribute for agents registered as V50 and later
Overview of the name-value tuple format
About the entry point timeouts
ArgListValues attribute for agents registered as V40 and earlier
3. Creating entry points in C++
About creating entry points in C++
Entry point examples in this chapter
Data Structures
Syntax for C++ entry points
Syntax for C++ VCSAgStartup
Syntax for C++ monitor
Syntax for C++ info
Syntax for C++ online
Syntax for C++ offline
Syntax for C++ clean
Syntax for C++ action
Syntax for C++ attr_changed
Syntax for C++ open
Syntax for C++ close
Syntax for C++ shutdown
Agent framework primitives
VCSAgGetMonitorLevel
VCSAgGetFwVersion
VCSAgGetRegVersion
VCSAgRegisterEPStruct
VCSAgSetCookie2
VCSAgRegister
VCSAgUnregister
VCSAgGetCookie
VCSAgStrlcpy
VCSAgStrlcat
VCSAgSnprintf
VCSAgCloseFile
VCSAgDelString
VCSAgExec
VCSAgExecWithTimeout
VCSAgGenSnmpTrap
VCSAgSendTrap
VCSAgLockFile
VCSAgInitEntryPointStruct
VCSAgSetStackSize
VCSAgUnlockFile
VCSAgDisableCancellation
VCSAgRestoreCancellation
VCSAgValidateAndSetEntryPoint
VCSAgSetLogCategory
VCSAgGetProductName
VCSAgMonitorReturn
VCSAgSetResEPTimeout
VCSAgDecryptKey
VCSAgGetConfDir
VCSAgGetHomeDir
VCSAgGetLogDir
VCSAgGetSystemName
Agent Framework primitives for container support
VCSAgIsContainerUp
VCSAgGetContainerTypeEnum
VCSAgExecInContainer2
VCSAgIsContainerCapable
VCSAgExecInContainerWithTimeout
VCSAgGetUID
VCSAgIsPidInContainer
VCSAgIsProcInContainer
VCSAgGetContainerID2
VCSAgGetContainerName2
VCSAgGetContainerBasePath
VCSAgGetContainerEnabled
4. Creating entry points in scripts
About creating entry points in scripts
Rules for using script entry points
Parameters and values for script entry points
ArgList attributes
Examples
Syntax for script entry points
Syntax for the monitor script
Syntax for the online script
Syntax for the offline script
Syntax for the clean script
Syntax for the action script
Syntax for the attr_changed script
Syntax for the info script
Syntax for the open script
Syntax for the close script
Syntax for the shutdown script
Syntax for the imf_init script
Syntax for the imf_register script
Syntax for the imf_getnotification script
Example script entry points
Online entry point for FileOnOff
Monitor entry point for FileOnOff
Monitor entry point with intentional offline
Offline entry point for FileOnOff
Monitor entry point for agent having basic (level-1) and detailed (level-2) monitoring
5. Logging agent messages
About logging agent messages
Logging in C++ and script-based entry points
Agent messages: format
C++ agent logging APIs
Agent application logging macros for C++ entry points
Agent debug logging macros for C++ entry points
Severity arguments for C++ macros
Initializing function_name using VCSAG_LOG_INIT
Log category
Examples of logging APIs used in a C++ agent
Script entry point logging functions
Using functions in scripts
VCSAG_SET_ENVS
VCSAG_LOG_MSG
VCSAG_LOGDBG_MSG
Example of logging functions used in a script agent
6. Building a custom agent
Files for use in agent development
Creating the type definition file for a custom agent
Naming convention for the type definition file
Example: Type definition file for the FileOnOff agent on Linux
Requirements for creating the agentTypes.cf file
Example: FileOnOffTypes.cf
Example: Type definition for a custom agent that supports intentional offline
Adding the custom type definition to the configuration
Building a custom agent on UNIX
Implementing entry points using scripts
Example: Using script entry points on UNIX
Example: Using VCSAgStartup() and script entry points on UNIX
Implementing entry points using C++
Example: Using C++ entry points on UNIX
Example: Using C++ and script entry points on UNIX
Installing the custom agent
Defining resources for the custom resource type
Sample resource definition
7. Building a script based IMF-aware custom agent
About building a script based IMF-aware custom agent
Linking AMF plugins with script agent
Creating XML file required for AMF plugins to do resource registration for online and offline state monitoring
Example of amfregister.xml for registration of process-based resource with AMF for online monitoring
Example of amfregister.xml for registration of process-based resource with AMF for offline monitoring
Example of amfregister.xml for online and offline IMF monitoring for a given process
Adding IMF and IMFRegList attributes in configuration
Monitor without IMF integration
Monitor without IMF but with LevelTwo monitor frequency
Monitor with IMF integration
Monitor with IMF but with LevelTwo monitor frequency
Installing the custom script-based agent built to enable IMF
8. Testing agents
About testing agents
Using debug messages
Debugging agent functions (entry points).
Debugging the agent framework
Debugging using AdvDbg attribute
Working of AdvDbg attribute
Impact of AdvDbg attribute on existing functionality of the entry point
Using the engine process to test agents
Test commands
Using the AgentServer utility to test agents
9. Static type attributes
About static attributes
Overriding static type attributes
Static type attribute definitions
ActionTimeout
AdvDbg
AEPTimeout
AgentClass
AgentDirectory
AgentFailedOn
AgentFile
AgentPriority
AgentReplyTimeout
AgentStartTimeout
AlertOnMonitorTimeouts
ArgList
AttrChangedTimeout
CleanRetryLimit
CleanTimeout
CloseTimeout
ContainerOpts
ConfInterval
EPClass
EPPriority
ExternalStateChange
FaultOnMonitorTimeouts
FaultPropagation
FireDrill
IMF
IMFRegList
InfoInterval
InfoTimeout
IntentionalOffline
LevelTwoMonitorFreq
LogDbg
LogFileSize
ManageFaults
MonitorInterval
MonitorStatsParam
MonitorTimeout
NumThreads
OfflineMonitorInterval
OfflineTimeout
OfflineWaitLimit
OnlineClass
OnlinePriority
OnlineRetryLimit
OnlineTimeout
OnlineWaitLimit
OpenTimeout
Operations
RegList
RestartLimit
ScriptClass
ScriptPriority
SourceFile
SupportedActions
ToleranceLimit
10. State transition diagram
State transitions
State transitions with respect to ManageFaults attribute
11. Internationalized messages
About internationalized messages
Creating SMC files
SMC format
Example SMC file
Formatting SMC files
Naming SMC files, BMC files
Message examples
Using format specifiers
Converting SMC files to BMC files
Storing BMC files
Displaying the contents of BMC files
Using BMC Map Files
Location of BMC Map Files
Creating BMC Map Files
Example BMC Map File
Updating BMC Files
A.
Using pre-5.0 VCS agents and registering them as V51 or later
Outline of steps to change V40 agents V51
Name-value tuple format for agents registered as V51 or later
Sourcing ag_i18n_inc modules in script entry points
Guidelines for using pre-VCS 4.0 Agents
Log messages in pre-VCS 4.0 agents
Mapping of log tags (pre-VCS 4.0) to log severities (VCS 4.0)
How Pre-VCS 4.0 Messages are Displayed by VCS 4.0 and Later
Comparing Pre-VCS 4.0 APIs and VCS 4.0 Logging Macros
Pre-VCS 4.0 Message APIs
VCSAgLogConsoleMsg
VCSAgLogI18NMsg
VCSAgLogI18NMsgEx
VCSAgLogI18NConsoleMsg
VCSAgLogI18NConsoleMsgEx

Attachments

vcs_agent_dev_60_unix.pdf (1.9 MBytes)

Legacy ID



uxrt-60_vcs_agent_dev_60_v69505784


Article URL http://www.symantec.com/docs/DOC5232


Terms of use for this information are found in Legal Notices