<commit_before># Agent Check: IBM Db2

## Overview

This check monitors [IBM Db2][1] through the Datadog Agent.

## Setup

### Installation

The IBM Db2 check is included in the [Datadog Agent][2] package.

#### Dependencies

The [ibm_db][3] client library is required. To install it, ensure you have a working compiler and run:

Unix:

```
/opt/datadog-agent/embedded/bin/pip install ibm_db==3.0.1
```

Windows:

```
"C:\Program Files\Datadog\Datadog Agent\embedded\Scrips\python.exe" -m pip install ibm_db==3.0.1
```

Additionally, 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).

#### Privileges

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
```

Now if you run `get dbm cfg`, 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<commit_msg>Fix typo (#3466)<commit_after># Agent Check: IBM Db2

## Overview

This check monitors [IBM Db2][1] through the Datadog Agent.

## Setup

### Installation

The IBM Db2 check is included in the [Datadog Agent][2] package.

#### Dependencies

The [ibm_db][3] client library is required. To install it, ensure you have a working compiler and run:

Unix:

```
/opt/datadog-agent/embedded/bin/pip install ibm_db==3.0.1
```

Windows:

```
"C:\Program Files\Datadog\Datadog Agent\embedded\Scripts\python.exe" -m pip install ibm_db==3.0.1
```

Additionally, 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).

#### Privileges

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
```

Now if you run `get dbm cfg`, 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
{'fraction_non_alphanumeric': 0.08024296675191815, 'fraction_numerical': 0.010230179028132993, 'mean_word_length': 2.592422502870264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1729257', 'n_tokens_mistral': 1011, 'n_tokens_neox': 936, 'n_words': 357}