Automatic HADR congestion detection and data collection

You can use the db2fodc command to monitor HADR congestion. If congestion is detected, HADR diagnostic data collection is triggered automatically to aid in the problem determination process.

To monitor HADR congestion and invoke automatic diagnostic data collection, specify the -hadr parameter with the -detect option for the db2fodc command, as shown:
db2fodc -hadr -db dbname -detect
The command starts a process which monitors the HADR database to see if there is enough congestion to invoke data collection. Once there is enough congestion, the db2cos_hadr (db2doc_hadr.bat on Windows operating systems) script is invoked and diagnostic data collection occurs. The process ends once diagnostic data collection completes. If there is not enough congestion ever detected, the monitor runs until the detection duration exceeds the duration parameter value, or the user terminates it by issuing the following command:
db2fodc -detect off

When monitoring HADR congestion without specifying any -detect suboptions, default settings are being applied. The settings are as follows:

Run HADR congestion detection for 1 iteration (iteration=1). During this iteration, run db2pd -hadr -db dbname every 30 seconds (interval=30). For each run of the command, check the output to see whether the HADR_CONNECT_STATUS output is CONGESTED. If there are 10 (triggercount=10) consecutive CONGESTED statuses, there is enough HADR congestion to invoke the db2cos_hadr script. The script will invoke to collect HADR data. Once the data collection is completed, the monitoring instance will terminate. If 10 consecutive CONGESTED statuses do not appear, the detect iteration will run until the detect duration exceeds the duration parameter value, or you stop the detect by issuing the db2fodc -detect off command in another session window. Therefore, running the following two commands would be equivalent:
db2fodc -hadr -db dbname -detect
db2fodc -hadr -db dbname -detect iteration=1 sleeptime=0 triggercount=10 interval=30