Skip to content

Deprecated instructions to install python dependencies for the Datadog Agent

Remi Hakim edited this page Jun 16, 2014 · 6 revisions

Prior to Agent 5.0.0, some Python dependencies needed by some checks were not bundled with the Datadog Agent.

This page aims at helping installing these dependencies if you want to use the Datadog Agent < 5.0.0

Cacti

  1. Install the python MySQL module on your Cacti server
    On Debian & Ubuntu
    sudo apt-get install python-mysqldb
    <pre class="verification"><code>python -c "import MySQLdb" |& grep ImportError && &#92;
    

    echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"

      On RedHat &amp; 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 && &#92;
    

    echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"

  2. <li>Install the python RRDtool module on your Cacti server
      <br/>On Debian &amp; Ubuntu
        <pre class="linux"><code>sudo apt-get install python-rrdtool</code></pre>
    
    <pre class="verification"><code>python -c "import rrdtool" |& grep ImportError && &#92;
    

    echo -e "\033[0;31mMissing rrdtool python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"

      On RedHat &amp; CentOS
    <pre class="linux"><code>sudo yum install rrdtool-python</code></pre>
    
    <pre class="verification"><code>python -c "import MySQLdb" 2>&1 | grep ImportError && &#92;
    

    echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"

GUnicorn

  1. Install the psutil Python library

HDFS

  1. Install the Python Snakebite module on your server running the Agent.
    If you're using a package installation, be sure that you have python-setuptools, then run:
    sudo easy_install snakebite
    On a source install
    cd ~/.datadog-agent
    . venv/bin/activate
    pip install snakebite
    For more details about installing the Python module, refer to the Snakebite documentation.

Kafka

  1. Install the required Kafka and Zookeeper libraries on your server.
  2. <ol>
        <li>Install pip if you don't have it already.
            <br /><em>On Debian &amp; Ubuntu</em>
            <pre class="linux"><code>sudo apt-get install python-pip</code></pre>
            <pre class="verification"><code>which pip >/dev/null && &#92;
    

    echo -e "\033[0;32mpip install - OK\033[0m" || \ echo -e "\033[0;31mMissing pip binary - Failure\033[0m"

            <em>On CentOS &amp; RedHat</em>
            <pre class="linux"><code>sudo yum install python-pip</code></pre>
            <pre class="verification"><code>which pip >/dev/null && &#92;
    

    echo -e "\033[0;32mpip install - OK\033[0m" || \ echo -e "\033[0;31mMissing pip binary - Failure\033[0m"

  3. 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 && &#92;
    

    echo -e "\033[0;31mMissing kafka python module - Failure\033[0m" || \ echo -e "\033[0;32mkafka python module - OK\033[0m"

Memcached

  1. Install the python-memcache module on your Memcached server
    On Debian & Ubuntu
    sudo 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 &amp; RedHat
    <pre class="linux"><code>sudo yum install python-memcached</code></pre>
    
    <pre class="verification"><code>python -c "import memcache" 2>&1 | grep ImportError && &#92;
    

    echo -e "\033[0;31mMissing memcached python module - Failure\033[0m" || \ echo -e "\033[0;32mpython memcache module - OK\033[0m"

MongoDB

  1. Install the Python MongoDB module on your MongoDB server
    sudo easy_install -U pymongo
    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"
    For more details about installing the Python module, refer to the pymongo documentation.

MySQL

  1. Install the python-mysqldb module on your MySQL server
    On Debian & Ubuntu
    sudo apt-get install python-mysqldb
    <pre class="verification"><code>python -c "import MySQLdb" |& grep ImportError && &#92;
    

    echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"

      On RedHat &amp; CentOS
    <pre class="linux"><code>sudo yum install MySQL-python</code></pre>
    <pre class="verification"><code>python -c "import MySQLdb" |& grep ImportError && &#92;
    

    echo -e "\033[0;31mMissing MySQLdb python module\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"

PostgreSQL

  1. Install the python-psycopg2 module on your PostgreSQL server
    On Debian & Ubuntu
    sudo 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 &amp; RedHat
    <pre class="linux"><code>sudo yum install python-psycopg2</code></pre>
    
    <pre class="verification"><code>python -c "import psycopg2" |& grep ImportError && &#92;
    

    echo -e "\033[0;31mMissing postgres python module - Failure\033[0m" || \ echo -e "\033[0;32mpython module - OK\033[0m"

Redis

  1. Install the python-redis module on your Redis server
    On Debian & Ubuntu
    sudo apt-get install python-redis
      <pre class="verification"><code>python -c "import redis" |& grep ImportError && &#92;
    

    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 && &#92;
    

    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 && &#92;
    

    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 running redis-cli info on a slave. If you are going to be capturing metrics from a redis slave, it's recommended that you use easy_install to get the latest version:

Clone this wiki locally