Preventing duplicate monitoring of database connections

When you add a Db2® on Cloud, Db2 Warehouse on Cloud or Db2 for IBM® Integrated Analytics System (IIAS) connection profile in IBM Db2 Data Management Console (DMC), database monitoring is duplicated both by its embedded unified console and Db2 Data Management Console.

About this task

To avoid duplicate monitoring and to improve system performance, you can disable the monitoring, or historical monitoring on either the unified console or the Db2 Data Management Console.

IBM Integrated Analytics System (IIAS) connection profile:

Prerequisite:

If the system level is 1.0.25 or earlier, copy the monitor_switch.sh file into web_console container path: /opt/ibm/dsserver/scripts. Ensure that /opt/ibm/dsserver/scripts/monitor_switch.sh script is executable.

If the system level is 1.0.26 or later, no action is required, as /opt/ibm/dsserver/scripts/monitor_switch.sh script is packaged.

The following code is the monitor_switch.sh script:
#!/bin/bash
### ************************************************************************###
###  IBM Confidential                                                       ###
###  OCO Source Materials                                                   ###
###  5724-E34                                                               ###
###  (c) Copyright IBM Corporation 2020.                                    ###
###  All rights reserved.                                                   ###
###                                                                         ###
###  The source code for this program is not published or otherwise         ###
###  divested of its trade secrets, irrespective of what has been           ###
###  deposited with the U.S. Copyright Office.                              ###
### ************************************************************************###

binDir=`dirname $0`
dsserver_home=$binDir/..
cd ${dsserver_home}
dsserver_home=`pwd`
export dsserver_home

PATH=${dsserver_home}/jre/bin:${PATH}
export PATH

JAVA_HOME=${dsserver_home}/jre
export JAVA_HOME

. ${dsserver_home}/bin/product.sh

utiljar=${dsserver_home}/dscomponents/CommonWeb/com.ibm.datatools.corehttpservices.util_2.4.0.jar:${dsserver_home}/dsutil/lib/com.ibm.datatools.corehttpservices.util_2.4.0.jar

CLASSPATH=${utiljar}:${CLASSPATH}
export CLASSPATH

if [ -z "$1" ]
then
    echo "Specify '-off' to turn off monitor component or '-on' to turn on monitor component."
    exit 1
fi

config="${dsserver_home}/Config/monitorprofile_bluhelix.properties"

if [ "$1" == "-off" ]
then
  java com.ibm.datatools.corehttpservices.util.PropertiesFileUpdater $config -rtmon_config.default.enabled false -repos_config.mondata.enabled false -repos_config.sqlstmtexedata.enabled false -repos_config.utility_events_data.enabled false -repos_config.sqlstmtexedata.indstmtenabled false -repos_config.lock_events_data.enabled false -repos_config.wlm_data.enabled false -repos_config.wlm_data.collect_data false >/dev/null
  echo "Monitor has been switched off. Please restart console..."
fi

if [ "$1" == "-on" ]
then
  java com.ibm.datatools.corehttpservices.util.PropertiesFileUpdater $config -rtmon_config.default.enabled true -repos_config.mondata.enabled true -repos_config.sqlstmtexedata.enabled true -repos_config.utility_events_data.enabled true -repos_config.sqlstmtexedata.indstmtenabled true -repos_config.lock_events_data.enabled true -repos_config.wlm_data.enabled true -repos_config.wlm_data.collect_data true >/dev/null
  echo "Monitor has been turned on. Please restart console..."
fi

exit 0
Procedure:
  1. On the head node (default node0101) of IIAS, access web_console container as root user:
    docker exec -it web_console bash
  2. Run the following command:
    /opt/ibm/dsserver/scripts/monitor_switch.sh -off
  3. Exit and restart web_console container.
    ap apps disable webconsole
    ap apps enable webconsole

If you want to switch back to use IIAS console for database monitoring, follow these steps:

  1. Remove the connection profile to the IIAS database in Db2 Data Management Console.
  2. On the head node (default node0101) of IIAS, access web_console container as root user:
    docker exec -it web_console bash
  3. Run the following command:
    /opt/ibm/dsserver/scripts/monitor_switch.sh -on
  4. Exit and restart web_console container.
    ap apps disable webconsole
    ap apps enable webconsole

Db2 Warehouse on Cloud connection profile:

Do one of the following:
  • Disable historical monitoring in the embedded unified console:
    1. Go to Settings > Monitoring profile.
    2. Set Historical monitoring to OFF.
  • Deactivate the monitoring profile or disable historical monitoring for your database connection in Db2 Data Management Console. To know more, refer to the procedure.

Db2 on Cloud connection profile:

Deactivate the monitoring profile or disable historical monitoring for your database connection in Db2 Data Management Console. To know more, refer to the procedure.

Procedure

To deactivate the monitoring profile or disable historical monitoring for your database connection in Db2 Data Management Console:

  1. Log in to IBM Db2 Data Management Console.
  2. Click Administration and select Monitoring profile.
    The Monitoring profile page displays.
  3. Do one of the following:
    • Deactivate monitoring for the connected database (Db2 on Cloud or Db2 Warehouse on Cloud. Select the monitoring profile and click Deactivate.
    • Disable historical monitoring for the connected database (Db2 on Cloud or Db2 Warehouse on Cloud.
      1. In the Monitoring profile page, select the monitoring profile and then click Edit.
      2. Click the Monitor settings tab and set Persistence to Off.
      3. Click Save.