This check monitors IBM Db2 through the Datadog Agent.
The IBM Db2 check is included in the Datadog Agent package.
The ibm_db client library is required. To install it, ensure you have a working compiler and run:
sudo -Hu dd-agent /opt/datadog-agent/embedded/bin/pip install ibm_db==3.0.1
For Agent versions <= 6.11:
"C:\Program Files\Datadog\Datadog Agent\embedded\python.exe" -m pip install ibm_db==3.0.1
For Agent versions >= 6.12 and < 7.0:
"C:\Program Files\Datadog\Datadog Agent\embedded<PYTHON_MAJOR_VERSION>\python.exe" -m pip install ibm_db==3.0.1
For Agent versions >= 7.0:
"C:\Program Files\Datadog\Datadog Agent\embedded3\python.exe" -m pip install ibm_db==3.1.0
On Linux there may be need for XML functionality. If you encounter errors during
the build process, install libxslt-dev
(or libxslt-devel
for RPM).
To query metrics from certain tables, specific privileges must be granted to the chosen Db2 user.
Switch to the instance master user and run these commands at the db2
prompt:
update dbm cfg using HEALTH_MON on
update dbm cfg using DFT_MON_STMT on
update dbm cfg using DFT_MON_LOCK on
update dbm cfg using DFT_MON_TABLE on
update dbm cfg using DFT_MON_BUFPOOL on
Next, run get dbm cfg
and you should see the following:
Default database monitor switches
Buffer pool (DFT_MON_BUFPOOL) = ON
Lock (DFT_MON_LOCK) = ON
Sort (DFT_MON_SORT) = OFF
Statement (DFT_MON_STMT) = ON
Table (DFT_MON_TABLE) = ON
Timestamp (DFT_MON_TIMESTAMP) = ON
Unit of work (DFT_MON_UOW) = OFF
Monitor health of instance and databases (HEALTH_MON) = ON
To configure this check for an Agent running on a host:
-
Edit the
ibm_db2.d/conf.yaml
file, in theconf.d/
folder at the root of your Agent's configuration directory to start collecting youribm_db2
performance data. See the sample ibm_db2.d/conf.yaml for all available configuration options.
Available for Agent versions >6.0
-
Collecting logs is disabled by default in the Datadog Agent, enable it in your
datadog.yaml
file:logs_enabled: true
-
Add this configuration block to your
ibm_db2.d/conf.yaml
file to start collecting your IBM Db2 logs:logs: - type: file path: /home/db2inst1/sqllib/db2dump/db2diag.log source: ibm_db2 service: db2sysc log_processing_rules: - type: multi_line name: new_log_start_with_date pattern: \d{4}\-(0?[1-9]|[12][0-9]|3[01])\-(0?[1-9]|1[012])
For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.
Parameter | Value |
---|---|
<INTEGRATION_NAME> |
ibm_db2 |
<INIT_CONFIG> |
blank or {} |
<INSTANCE_CONFIG> |
{"db": "<DB_NAME>", "username":"<USERNAME>", "password":"<PASSWORD>", "host":"%%host%%", "port":"%%port%%"} |
Available for Agent versions >6.0
Collecting logs is disabled by default in the Datadog Agent. To enable it, see Kubernetes Log Collection.
Parameter | Value |
---|---|
<LOG_CONFIG> |
`{"source": "ibm_db2", "service": "<SERVICE_NAME>", "log_processing_rules": {"type":"multi_line","name":"new_log_start_with_date", "pattern":"\d{4}-(0?[1-9] |
Run the Agent's status subcommand and look for ibm_db2
under the Checks section.
See metadata.csv for a list of metrics provided by this integration.
ibm_db2.tablespace_state_change
is triggered whenever the state of a tablespace changes.
See service_checks.json for a list of service checks provided by this integration.
Need help? Contact Datadog support.
Additional helpful documentation, links, and articles: