Skip to main content
Version: v1.7.x

Monitoring:DB2 database monitoring

Collect and monitor general performance metrics (tablespace, session status, process count, locks, slow queries, etc.) for DB2 databases.

Note: DB2 JDBC Driver JAR Must be Added

  • Download the DB2 JDBC driver JAR package, for example, jcc.jar.
  • Copy the JAR package to the hertzbeat/ext-lib directory.
  • Restart the HertzBeat service.

Configuration Parameters

The following are the required configuration parameters for DB2 monitoring:

Parameter NameParameter Description
Target HostThe IPv4, IPv6, or domain name of the monitored DB2 database server.
PortThe port provided by the DB2 database, default is 50000.
Database NameThe name of the DB2 database to connect to.
UsernameThe username for the database connection.
PasswordThe password for the database connection.
Query TimeoutSets the timeout for when an SQL query does not return data, in milliseconds (ms), default is 6000.
Reuse ConnectionWhether to reuse the database connection, boolean value, default is true.
URLThe database connection URL, optional. If configured, it will override the database name, username, and password parameters set above.

Collected Metrics

Metric Set: Basic Info

Metric NameMetric UnitMetric Description
database_versionNoneDatabase Version.
instance_nameNoneDatabase Instance Name.
statusNoneInstance Status.
num_dbNoneNumber of Databases.

Metric Set: Tablespace Usage

Metric NameMetric UnitMetric Description
tablespace_nameNoneTablespace Name.
statusNoneType.
totalMBTotal Size.
usedMBUsed Size.
freeMBFree Size.
used_percentagePercentage (%)Used Percentage.

Metric Set: Session Status

Metric NameMetric UnitMetric Description
status_typeNoneSession Status Type.
countNoneCount of sessions in that status.

Metric Set: Application Process Count

Metric NameMetric UnitMetric Description
process_countNoneTotal number of application processes/sessions.

Metric Set: Locks

Metric NameMetric UnitMetric Description
waiting_locksNoneNumber of currently waiting locks.

Metric Set: Slow Query

Metric NameMetric UnitMetric Description
avg_exe_timemsAverage Execution Time.
sql_textNoneSQL Text of the slow query.