From 9f42942640d54f370006f518f022cc83a5aea436 Mon Sep 17 00:00:00 2001 From: Andrew Zhang Date: Fri, 16 Jun 2023 10:53:36 -0400 Subject: [PATCH 1/2] Update wording and add extra install directions for ODBC --- ibm_db2/README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ibm_db2/README.md b/ibm_db2/README.md index 2f15110dc3bcf..957ec5bb15c8d 100644 --- a/ibm_db2/README.md +++ b/ibm_db2/README.md @@ -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==`, 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`. ``` 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- @@ -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/ \ No newline at end of file From f838e8052c51436210bbd9a1f8aa63fc57d35a9a Mon Sep 17 00:00:00 2001 From: Andrew Zhang Date: Fri, 16 Jun 2023 12:57:58 -0400 Subject: [PATCH 2/2] Update README.md --- ibm_db2/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ibm_db2/README.md b/ibm_db2/README.md index 957ec5bb15c8d..11957212d99be 100644 --- a/ibm_db2/README.md +++ b/ibm_db2/README.md @@ -174,7 +174,7 @@ If you're in an air gapped environment, or on a restricted network where it's no **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 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`. +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 @@ -251,4 +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/ \ No newline at end of file +[16]: https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/