Skip to content

Commit

Permalink
Update wording and add extra install directions for ODBC (#14781)
Browse files Browse the repository at this point in the history
* Update wording and add extra install directions for ODBC

* Update README.md
  • Loading branch information
yzhan289 authored Jun 20, 2023
1 parent bd25127 commit e28e516
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions ibm_db2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,33 @@ See [service_checks.json][11] for a list of service checks provided by this inte

### Installing `ibm_db` client library offline

If you're in an air gapped environment, or on a restricted network where it's not possible to run `pip install ibm_db==3.0.1`, you can install `ibm_db` using the following method:
If you're in an air gapped environment, or on a restricted network where it's not possible to run `pip install ibm_db==<version>`, you can install `ibm_db` using the following method:

**Note**: The following example assumes an Ubuntu machine, but the steps should also be similar on most operating systems.

1. On a machine with network access, download [the source tarball][14].
1. On a machine with network access, download the source tarballs for [the `ibm_db` library][14] and [the ODBC and CLI][16]. The ODBC and CLI are required to be downloaded separately because the `ibm_db` library requires them, but it cannot download them via `pip`. The following script installs the archive file for ibm_db==3.1.0:

```
curl -Lo ibm_db.tar.gz https://github.com/ibmdb/python-ibmdb/archive/refs/tags/v3.1.0.tar.gz
curl -Lo linuxx64_odbc_cli.tar.gz https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
```

1. Transport the file over to the restricted host, and then extract the archive:
1. Transport the two files over to the restricted host, and then extract the archive.

```
tar xvf ibm_db.tar.gz

tar xvf linuxx64_odbc_cli.tar.gz
```
1. Set the `IBM_DB_HOME` environment variable to the location of where `/clidriver` was extracted from `linuxx64_odbc_cli.tar.gz`. This will prevent the `ibm_db` library from installing a new version of the ODBC and CLI and failing.
```
export IBM_DB_HOME=/path/to/clidriver
```
1. Using the embedded [`pip`][15] on the Agent, run the following command:
1. Using the embedded [`pip`][15] on the Agent, run the following command to install the library locally.
```
/opt/datadog-agent/embedded/bin/pip install --no-index --no-deps --no-build-isolation python-ibmdb-
Expand Down Expand Up @@ -241,3 +251,4 @@ Additional helpful documentation, links, and articles:
[13]: https://www.datadoghq.com/blog/monitor-db2-with-datadog
[14]: https://pypi.org/project/ibm-db/#files
[15]: https://docs.datadoghq.com/developers/guide/custom-python-package/?tab=linux
[16]: https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/

0 comments on commit e28e516

Please sign in to comment.