About the monitor agent function for VCS agent for DB2

The agent executes the su $DB2InstOwner -c "$InstHome/sqllib/bin/db2gcf -s -i $DB2InstOwner -p $nodenum" command to check the status of the database partition or node number. If the exit status of the db2gcf command is 0, the monitor returns the exit code 110. Otherwise, the monitor returns an exit code of 100 and the resource is taken offline. The agent then restarts or fails over the resource. This action depends on other type-independent attributes, such as RestartLimit or ToleranceLimit.

Note:

In case of single partition, the monitor checks the process of the respective partition using ps -p command. And in case of multiple partions, db2gcf -s command is used

Set the IndepthMonitor attribute to 1 for in-depth monitoring. The agent looks for the monitor_custom_$db2instance_$nodenum file in the /opt/VRTSagents/ha/bin/Db2udb directory. It executes this customized in-depth monitor file, if the file exists and is executable. You can find samples of custom monitor scripts in the /etc/VRTSagents/ha/conf/Db2udb/sample_db2udb directory.

If the custom monitor has any errors or problems, it checks the value of the WarnOnlyIfDBQueryFailed attribute of the Db2udb agent. If you have a db2error.dat file in the /opt/VRTSagents/ha/bin/Db2udb directory, the agent checks this file, and handles the error according to the error configuration.

If you set the WarnOnlyIfDBQueryFailed attribute to 1 (its default), and you have configured the Notifier resource, the agent performs the following actions:

If you set the WarnOnlyIfDBQueryFailed attribute to 0, it performs error handling in the db2error.dat file. Note that the file needs to exist to perform error handling. If it does not exist, it returns the exit code 100, which is the default.

More Information

Handling DB2 error codes during in-depth monitoring