Supported OS Linux

インテグレーションバージョン2.1.0

概要

Cacti からメトリクスをリアルタイムに取得すると、以下のことができます。

  • Cacti の状態を視覚化および監視できます。
  • Cacti のフェイルオーバーとイベントの通知を受けることができます。

計画と使用

インフラストラクチャーリスト

Cacti チェックは Datadog Agent パッケージに含まれています。メトリクスの収集を開始するには、次の手順に従います。

  1. librrd ヘッダーおよびライブラリをインストールします。
  2. Python バインディングを rrdtool にインストールします。

ヘッダーおよびライブラリ

Debian/Ubuntu の場合

sudo apt-get install librrd-dev

RHEL/CentOS の場合

sudo yum install rrdtool-devel

Python バインディング

以下のコマンドを使用して、rrdtool Python パッケージを Agent に追加します。

sudo -u dd-agent /opt/datadog-agent/embedded/bin/pip install rrdtool

ブラウザトラブルシューティング

Datadog ユーザーの作成

  1. Cacti データベースへの読み取り専用権限を持つ Datadog ユーザーを作成します。

    sudo mysql -e "create user 'datadog'@'localhost' identified by '<MYSQL_PASSWORD>';"
    sudo mysql -e "grant select on cacti.* to 'datadog'@'localhost';"
    
  2. ユーザーと権限をチェックします。

    mysql -u datadog --password=<MYSQL_PASSWORD> -e "show status" | \
    grep Uptime && echo -e "\033[0;32mMySQL user - OK\033[0m" || \
    echo -e "\033[0;31mCannot connect to MySQL\033[0m"
    
    mysql -u datadog --password=<MYSQL_PASSWORD> -D cacti -e "select * from data_template_data limit 1" && \
    echo -e "\033[0;32mMySQL grant - OK\033[0m" || \
    echo -e "\033[0;31mMissing SELECT grant\033[0m"
    
  3. datadog-agent ユーザーに RRD ファイルへのアクセス権を付与します。

    sudo gpasswd -a dd-agent www-data
    sudo chmod -R g+rx /var/lib/cacti/rra/
    sudo su - datadog-agent -c 'if [ -r /var/lib/cacti/rra/ ];
    then echo -e "\033[0;31mdatadog-agent can read the RRD files\033[0m";
    else echo -e "\033[0;31mdatadog-agent can not read the RRD files\033[0m";
    fi'
    

Agent の構成

  1. Agent が MySQL に接続するように構成し、cacti.d/conf.yaml ファイルを編集します。使用可能なすべてのコンフィギュレーションオプションの詳細については、cacti.d/conf.yaml のサンプルを参照してください。

    init_config:
    
    instances:
      ## @param mysql_host - string - required
      ## url of your MySQL database
      #
      - mysql_host: "localhost"
    
        ## @param mysql_port - integer - optional - default: 3306
        ## port of your MySQL database
        #
        # mysql_port: 3306
    
        ## @param mysql_user - string - required
        ## User to use to connect to MySQL in order to gather metrics
        #
        mysql_user: "datadog"
    
        ## @param mysql_password - string - required
        ## Password to use to connect to MySQL in order to gather metrics
        #
        mysql_password: "<MYSQL_PASSWORD>"
    
        ## @param rrd_path - string - required
        ## The Cacti checks requires access to the Cacti DB in MySQL and to the RRD
        ## files that contain the metrics tracked in Cacti.
        ## In almost all cases, you'll only need one instance pointing to the Cacti
        ## database.
        ## The `rrd_path` will probably be `/var/lib/cacti/rra` on Ubuntu
        ## or `/var/www/html/cacti/rra` on any other machines.
        #
        rrd_path: "<CACTI_RRA_PATH>"
    
  2. Agent を再起動します

検証

Agent の status サブコマンドを実行し、Checks セクションで cacti を探します。

リアルユーザーモニタリング

データセキュリティ

cacti.hosts.count
(gauge)
The number of hosts monitored by Cacti
Shown as host
cacti.metrics.count
(gauge)
The number of metrics collected from Cacti
cacti.rrd.count
(gauge)
The number of Cacti RRD files
Shown as file
system.disk.free.last
(gauge)
The amount of disk space that is free - last polling value
Shown as byte
system.disk.free.max
(gauge)
The amount of disk space that is free - max polling value
Shown as byte
system.disk.free.min
(gauge)
The amount of disk space that is free - min polling value
Shown as byte
system.disk.used.last
(gauge)
The amount of disk space that is used - last polling value
Shown as byte
system.disk.used.max
(gauge)
The amount of disk space that is used - max polling value
Shown as byte
system.disk.used.min
(gauge)
The amount of disk space that is used - min polling value
Shown as byte
system.load.1.last
(gauge)
The average system load over one minute - last polling value
system.load.1.max
(gauge)
The average system load over one minute - max polling value
system.load.1.min
(gauge)
The average system load over one minute - min polling value
system.load.15.last
(gauge)
The average system load over 15 minute - last polling value
system.load.15.max
(gauge)
The average system load over 15 minute - max polling value
system.load.15.min
(gauge)
The average system load over 15 minute - min polling value
system.load.5.last
(gauge)
The average system load over five minute - last polling value
system.load.5.max
(gauge)
The average system load over five minute - max polling value
system.load.5.min
(gauge)
The average system load over five minute - min polling value
system.mem.buffered.last
(gauge)
The amount of physical RAM used for file buffers - last polling value
Shown as byte
system.mem.buffered.max
(gauge)
The amount of physical RAM used for file buffers - max polling value
Shown as byte
system.mem.buffered.min
(gauge)
The amount of physical RAM used for file buffers - min polling value
Shown as byte
system.ping.latency
(gauge)
The system ping latency - avg polling value
Shown as millisecond
system.ping.latency.max
(gauge)
The system ping latency - max polling value
Shown as millisecond
system.proc.running.last
(gauge)
The number of processes running - last polling value
Shown as process
system.proc.running.max
(gauge)
The number of processes running - max polling value
Shown as process
system.proc.running.min
(gauge)
The number of processes running - min polling value
Shown as process
system.swap.free.max
(gauge)
The amount of free swap space - max polling value
Shown as byte
system.users.current.last
(gauge)
The number of logged in users - last polling value
system.users.current.max
(gauge)
The number of logged in users - max polling value
system.users.current.min
(gauge)
The number of logged in users - min polling value

収集データ

  1. Datadog Agent で、ログの収集はデフォルトで無効になっています。以下のように、datadog.yaml ファイルでこれを有効にします。

    logs_enabled: true
    
  2. Cacti ログの収集を開始するには、次のコンフィギュレーションブロックを cacti.d/conf.yaml ファイルに追加します。

    logs:
      - type: file
        path: /opt/cacti/log/cacti.log
        source: cacti
    

    path パラメーターの値を環境に合わせて変更します。使用可能なすべてのコンフィギュレーションオプションについては、cacti.d/conf.yaml のサンプルを参照してください。

  3. Agent を再起動します

ヘルプ

Cacti チェックには、イベントは含まれません。

ヘルプ

Cacti チェックには、サービスのチェック機能は含まれません。

ヘルプ

既知の問題

このインテグレーションが使用する Python ライブラリは、状況によってはメモリリークが発生することがあります。これが発生する場合は、1 つの回避策として、rrdtool の代わりに python-rrdtool パッケージをインストールしてください。この古いパッケージはメンテナンスされておらず、このインテグレーションでは公式にサポートされていませんが、メモリに関する問題の解決に利用できます。

このメモリリークの問題を追跡する Github イシューがオープンされています。

ご不明な点は、Datadog のサポートチームまでお問合せください。