Skip to main content

Agent Installation

The following guides you to the basic installation method for using the WhaTap database monitoring service.

Checking the configuration diagram

The DBX agent can be installed on a separate server or on the DB server. Select a method how to install the agent and check its configuration and firewall.

Install on a separate serverInstall on the DB server

Account creation

User accounts in DB2 are synchronized with user accounts in the operating system. Therefore, after creating an OS user, assign roles in the DB.

Creating an OS user for monitoring

Create a monitoring account in the same group as the DB installation account.

  1. Check the group name of the DB installation account.

    db2 get dbm cfg | grep "SYSADM_GROUP"
  2. Check the gid of the group name confirmed in 1.

    cat /etc/passwd | grep {group_name}
  3. Create an OS account with the gid confirmed in 2.

    useradd -g {gid} {DB_User}

Assigning the roles

Connect to the DB with the DB installation account and then assign the following roles:

v11.1 or later
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_CONNECTION TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_DATABASE TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TRANSACTION_LOG TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_BUFFERPOOL TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_ACTIVITY TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_MEMORY_SET TO USER {DB_User};
GRANT SELECT ON TABLE SYSIBMADM.MON_LOCKWAITS TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_APPL_LOCKWAIT TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_LOCKS TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLESPACE TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_CONTAINER TO USER {DB_User};
GRANT SELECT ON EXPLAIN_STREAM TO {DB_User};
GRANT SELECT ON EXPLAIN_OPERATOR TO {DB_User};
GRANT SELECT ON EXPLAIN_STATEMENT TO {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_WORKLOAD TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.WLM_GET_SERVICE_CLASS_AGENTS TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_DATABASE_DETAILS TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_FORMAT_XML_WAIT_TIMES_BY_ROW TO USER {DB_User};
GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_UNIT_OF_WORK TO USER {DB_User};
Note
  • If you have an account with roles, skip this step and then proceed to Next Step.

  • In the example code, DB_User is the DB user account name. Change it to your account name.

  • Enter your password in DB_Password in the example code.

Downloading the DBX agent

Download the DBX agent file. Use the following two methods.

  • You can download it by using the 'wget' command.

    BASH
    wget -O whatap.agent.database.tar.gz "https://service.whatap.io/download/dbx_agent?type=db2&format=tar.gz"
  • If you cannot download it with the command, select Download on the WhaTap monitoring service screen.

Download the DBX agent file and then unzip it.

BASH
tar -zxvf whatap.agent.database.tar.gz
Note

For users who cannot download tar files due to security settings, ZIP files are also provided. On the installation screen, select the .zip Download button.

DBX Agent Setting

Follow the instructions on the agent installation screen to configure the agent. By entering the required items on the screen, the configuration and commands can be auto-completed.

whatap.conf configuration

Go to the unzipped folder and then check the whatap.conf file. In whatap.conf, enter the project access key, WhaTap server data, and DB connection data.

whatap.conf
license={AccessKey}
whatap.server.host=13.124.11.223/13.209.172.35 # WhaTap server information

dbms=db2
db={DB}
db_ip={DB_Server_IP}
db_port={DB_Server_Port}

Downloading JDBC

Copy the db2jcc4.jar file from the /db2_instance_path/sqllib/java path of the DB server and then place it in the /agent_installation_path/jdbc folder.

/unzipped folder/jdbc
Note

For more information about the JDBC driver configuration in IBM DB2, see the following link.

Creating DB users and changing passwords

Generate an encrypted UID for database connection. Enter the username and password and then run the shell script (or batch file).

Tip

When changing the password, enter the new password and follow the same procedure.

BASH
./uid.sh {DB_USER} {DB_PASSWORD}
Note
  • After setting it once, it collects data from the database server to be monitored through the encrypted UID.

  • To create a DB user file, enter the project access key in the whatap.conf file. Checking the access key

  • In the Azure database environment, enter DB_USER in the form of DB_USER@DB_name.

  • If special characters are included in DB_USER or DB_PASSWORD, enter the escape character (\) together before any special characters.

    Example
    ./uid.sh whatap whatap\!pwd

    # If there are multiple special characters, add the escape character(\) for each.
    ./uid.sh whatap whatap\!\@pwd

Starting the monitoring

Execute a shell script (or batch file) from the path where you have installed the agent.

./start.sh

To use it like a daemon, execute the following command. However, it works only in the environment where nohup has been installed.

./startd.sh

You completed installing the agent for database monitoring. In the following, check the post-installation checklist.

Installing the additional agent (XOS) and applying other options

To additionally monitor the resources of the database server, run a separate XOS agent process on the database server to collect data.

Note
  • It can be applied to only the OS environment running on the x86 architecture.

  • The additional agent installation process is optional.

  • For more information about the XOS agent configuration options, see the following.

Configuring the whatap.conf file

Set the following options in the whatap.conf file in the path where the DBX agent has been installed.

whatap.conf
xos=1
xos_port=3002

Move the xos folder (/unzip folder/xos/) to the database server.

Configuring the xos.conf file

Set the following options in the xos.conf file in the xos path moved to the database server.

xos.conf
dbx_ip={DB_Agent_IP}
dbx_port=3002 # default 3002
cpu_limit=0
mem_limit=10240
Tip

In Agent Installation, when you enter the DB data to DB Agent IP and DB Agent Port, the agent options are automatically generated.

Running the XOS agent

Run the XOS agent.

./start.sh
Note
  • To transmit monitored data to the DBX agent, the port set to dbx_port (default 3002) must have been open. (UDP Outbound)

  • To run the XOS agent in the background, run the ./startd.sh file.

Next steps

  • Checking the installation

    If you have created a project, installed an agent, and applied all agent options, see the checklist in the following.

  • Installation troubleshooting

    It provides various problems that may occur when installing the agent and specific instructions for resolving them. For more information, see the following.

  • Agent setting

    It provides various features for monitoring by applying some options to the agent configuration file (whatap.conf). For more information, see the following.

    To additionally monitor the database server resources, set more options in the additional agent (XOS). For more information, see the following.

  • Starting the monitoring

    After configuring all settings, the agent starts collecting metrics data from the database server. First, check whether the monitoring data has been collected in Instance List. For more information about Instance List, see the following.