-
Notifications
You must be signed in to change notification settings - Fork 813
Deprecated instructions to install python dependencies for the Datadog Agent
Prior to Agent 5.0.0, some Python dependencies needed by some checks were not bundled with the Datadog Agent.
If you are using using the Datadog Agent version < 5.0.0 and want to install the dependencies, please follow the instructions below.
- Install the python MySQL module on your Cacti server
On Debian & Ubuntusudo apt-get install python-mysqldb
<pre class="verification"><code>python -c "import MySQLdb" |& grep ImportError && \
echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
On RedHat & CentOS <pre class="linux"><code>sudo yum install -y MySQL-python</code></pre> <pre class="verification"><code>python -c "import MySQLdb" 2>&1 | grep ImportError && \
echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
<li>Install the python RRDtool module on your Cacti server
<br/>On Debian & Ubuntu
<pre class="linux"><code>sudo apt-get install python-rrdtool</code></pre>
<pre class="verification"><code>python -c "import rrdtool" |& grep ImportError && \
echo -e "\033[0;31mMissing rrdtool python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
On RedHat & CentOS
<pre class="linux"><code>sudo yum install rrdtool-python</code></pre>
<pre class="verification"><code>python -c "import MySQLdb" 2>&1 | grep ImportError && \
echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
- Install the psutil Python library
- Install the Python Snakebite module on your server running the Agent.
If you're using a package installation, be sure that you havepython-setuptools
, then run:On a source installsudo easy_install snakebite
For more details about installing the Python module, refer to the Snakebite documentation.cd ~/.datadog-agent . venv/bin/activate pip install snakebite
- Install the required Kafka and Zookeeper libraries on your server.
- Install the Kazoo Zookeeper library.
sudo pip install kazoo
python -c "import kazoo" |& grep ImportError && \ echo -e "\033[0;31mMissing kazoo python module - Failure\033[0m" || \ echo -e "\033[0;32mkazoo python module - OK\033[0m"
</li> <li>Install Kafka Python library, pinned to a specific version. <pre class="linux"><code>sudo pip install git+https://github.com/mumrah/kafka-python@61a0cb6f83e36172e2926c7c6813c7a56c857acc</code></pre> <pre class="verification"><code>python -c "import kafka" |& grep ImportError && \
echo -e "\033[0;31mMissing kafka python module - Failure\033[0m" || \ echo -e "\033[0;32mkafka python module - OK\033[0m"
<ol>
<li>Install pip if you don't have it already.
<br /><em>On Debian & Ubuntu</em>
<pre class="linux"><code>sudo apt-get install python-pip</code></pre>
<pre class="verification"><code>which pip >/dev/null && \
echo -e "\033[0;32mpip install - OK\033[0m" || \ echo -e "\033[0;31mMissing pip binary - Failure\033[0m"
<em>On CentOS & RedHat</em>
<pre class="linux"><code>sudo yum install python-pip</code></pre>
<pre class="verification"><code>which pip >/dev/null && \
echo -e "\033[0;32mpip install - OK\033[0m" || \ echo -e "\033[0;31mMissing pip binary - Failure\033[0m"
- Install the
python-memcache
module on your Memcached server
On Debian & Ubuntusudo apt-get install python-memcache
python -c "import memcache" 2>&1 | grep ImportError && \ echo -e "\033[0;31mMissing memcache python module - Failure\033[0m" || \ echo -e "\033[0;32mpython memcache module - OK\033[0m"
<br/>On Centos & RedHat <pre class="linux"><code>sudo yum install python-memcached</code></pre> <pre class="verification"><code>python -c "import memcache" 2>&1 | grep ImportError && \
echo -e "\033[0;31mMissing memcached python module - Failure\033[0m" || \ echo -e "\033[0;32mpython memcache module - OK\033[0m"
- Install the Python MongoDB module on your MongoDB server
sudo easy_install -U pymongo
For more details about installing the Python module, refer to the pymongo documentation.python -c "import pymongo" 2>&1 | grep ImportError && \ echo -e "\033[0;31mpymongo python module - Missing\033[0m" || \ echo -e "\033[0;32mpymongo python module - OK\033[0m"
- Install the
python-mysqldb
module on your MySQL server
On Debian & Ubuntusudo apt-get install python-mysqldb
<pre class="verification"><code>python -c "import MySQLdb" |& grep ImportError && \
echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
On RedHat & CentOS <pre class="linux"><code>sudo yum install MySQL-python</code></pre> <pre class="verification"><code>python -c "import MySQLdb" |& grep ImportError && \
echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
- Find the Nagios log on your server. (Usually /var/log/nagios3/nagios.log)
sudo find /etc -type f -name nagios.cfg -exec grep log_file {} \;
- Configure the Datadog Agent to access Nagios
Edit /etc/dd-agent/datadog.conf and add:nagios_log: /var/log/nagios3/nagios.log
- Install the
python-psycopg2
module on your PostgreSQL server
On Debian & Ubuntusudo apt-get install python-psycopg2
python -c "import psycopg2" |& grep ImportError && \ echo -e "\033[0;31mMissing postgres python module - Failure\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
<br/>On Centos & RedHat <pre class="linux"><code>sudo yum install python-psycopg2</code></pre> <pre class="verification"><code>python -c "import psycopg2" |& grep ImportError && \
echo -e "\033[0;31mMissing postgres python module - Failure\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"
- Install the
python-redis
module on your Redis server
On Debian & Ubuntusudo apt-get install python-redis
<pre class="verification"><code>python -c "import redis" |& grep ImportError && \
echo -e "\033[0;31mMissing redis python module - Failure\033[0m" || \ echo -e "\033[0;32mredis python module - OK\033[0m"
On RedHat/CentOS 5 <pre class="linux"><code>wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
sudo yum localinstall epel-release-5-4.noarch.rpm wget http://dl.fedoraproject.org/pub/epel/5/i386/python-redis-2.0.0-2.el5.noarch.rpm sudo yum localinstall python-redis-2.0.0-2.el5.noarch.rpm
<pre class="verification"><code>python2.6 -c "import redis" 2>&1 | grep ImportError && \
echo -e "\033[0;31mMissing redis python module - Failure\033[0m" || \ echo -e "\033[0;32mredis python module - OK\033[0m"
On RedHat/CentOS 6 <pre class="linux"><code>wget http://dl.fedoraproject.org/pub/epel/6/i386/python-redis-2.0.0-1.el6.noarch.rpm
sudo yum localinstall python-redis-2.0.0-1.el6.noarch.rpm
<pre class="verification"><code>python2.6 -c "import redis" 2>&1 | grep ImportError && \
echo -e "\033[0;31mMissing redis python module - Failure\033[0m" || \ echo -e "\033[0;32mredis python module - OK\033[0m"
Note: There is a known issue with python-redis 2.0.0 that causes it to fail on runningredis-cli info
on a slave. If you are going to be capturing metrics from a redis slave, it's recommended that you useeasy_install
to get the latest version: