この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
mae3xx_tips:setup_zabbix_agent:start [2014/07/31 09:43] admin |
mae3xx_tips:setup_zabbix_agent:start [2014/08/27 11:17] (現在) admin |
||
---|---|---|---|
ライン 1: | ライン 1: | ||
+ | ====== Zabbix (Agent) の設定 ====== | ||
+ | MA-E3xxには、Zabbix Agent をインストールしてあります。\\ | ||
+ | 設定することにより、Zabbix により監視・制御をすることが可能です。 | ||
+ | |||
+ | [[http://www.zabbix.com/jp/|{{zabbix_logo.jpg|オフィシャルサイト}}]] \\ | ||
+ | [[http://www.zabbix.com/jp/|オフィシャルサイト]] | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | とても役に立つ参考書を紹介しておきます。 | ||
+ | |||
+ | [[http://gihyo.jp/book/2014/978-4-7741-6543-1|{{http://image.gihyo.co.jp/assets/images/cover/2014/thumb/TH160_9784774165431.jpg|改訂版 Zabbix統合監視実践入門 ─ 障害通知,傾向分析,可視化による省力運用}}]] | ||
+ | [[http://gihyo.jp/book/2014/978-4-7741-6288-1|{{http://image.gihyo.co.jp/assets/images/cover/2014/thumb/TH160_9784774162881.jpg|Zabbix統合監視徹底活用 ─ 複雑化・大規模化するインフラの一元管理}}]] | ||
+ | |||
+ | \\ | ||
+ | |||
+ | 監視中の画面例です。 | ||
+ | |||
+ | {{zabbix_agent_00.png?800|監視画面の例 (MA-E320監視中)}} | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== 監視可能項目 ===== | ||
+ | |||
+ | 取得・監視できる項目は、下の表のとおりです。 | ||
+ | |||
+ | ^ Application ^ Item ^ Graph/History | | ||
+ | | CPU |Context switches per second| G | | ||
+ | |:::|CPU idle time| G | | ||
+ | |:::|CPU interrupt time| G | | ||
+ | |:::|CPU iowait time| G | | ||
+ | |:::|CPU nice time| G | | ||
+ | |:::|CPU softirq time| G | | ||
+ | |:::|CPU steal time| G | | ||
+ | |:::|CPU system time| G | | ||
+ | |:::|CPU user time| G | | ||
+ | |:::|Interrupts per second| G | | ||
+ | |:::|Processor load (1 min average per core)| G | | ||
+ | |:::|Processor load (5 min average per core)| G | | ||
+ | |:::|Processor load (15 min average per core)| G | | ||
+ | | General |Host boot time| G | | ||
+ | |:::|Host local time| G | | ||
+ | |:::|Host name| H | | ||
+ | |:::|System information| H | | ||
+ | |:::|System uptime| G | | ||
+ | | Memory |Available memory| G | | ||
+ | |:::|Free swap space| G | | ||
+ | |:::|Free swap space in %| G | | ||
+ | |:::|Total memory| G | | ||
+ | |:::|Total swap space| G | | ||
+ | | Network interfaces |Incoming network traffic on dummy0| G | | ||
+ | |:::|Incoming network traffic on eth0| G | | ||
+ | |:::|Incoming network traffic on eth1| G | | ||
+ | |:::|Incoming network traffic on gre0| G | | ||
+ | |:::|Incoming network traffic on gretap0| G | | ||
+ | |:::|Incoming network traffic on ip\_vti0| G | | ||
+ | |:::|Incoming network traffic on tunl0| G | | ||
+ | |:::|Outgoing network traffic on dummy0| G | | ||
+ | |:::|Outgoing network traffic on eth0| G | | ||
+ | |:::|Outgoing network traffic on eth1| G | | ||
+ | |:::|Outgoing network traffic on gre0| G | | ||
+ | |:::|Outgoing network traffic on gretap0| G | | ||
+ | |:::|Outgoing network traffic on ip\_vti0| G | | ||
+ | |:::|Outgoing network traffic on tunl0| G | | ||
+ | | OS |Host boot time| G | | ||
+ | |:::|Host local time| G | | ||
+ | |:::|Host name| H | | ||
+ | |:::|Maximum number of opened files| G | | ||
+ | |:::|Maximum number of processes| G | | ||
+ | |:::|Number of logged in users| G | | ||
+ | |:::|System information| H | | ||
+ | |:::|System uptime| G | | ||
+ | | Performance | ("CPU" と同じ) || | ||
+ | | Processes |Number of processes| G | | ||
+ | |:::|Number of running processes| G | | ||
+ | | Security |Checksum of /etc/passwd| G | | ||
+ | | Zabbix agent |Agent ping| G | | ||
+ | |:::|Host name of zabbix\_agentd running| H | | ||
+ | |:::|Version of zabbix\_agent(d) running| H | | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== 設定 ===== | ||
+ | |||
+ | ==== Agent (端末側) の設定 ==== | ||
+ | |||
+ | === 設定ファイルの編集 === | ||
+ | |||
+ | Zabbix Agent の設定ファイルは、/etc/zabbix/zabbix_agentd.conf です。\\ | ||
+ | いくつかの項目を設定します。 | ||
+ | |||
+ | <code> | ||
+ | user1@plum:~$ sudo nano -w /etc/zabbix/zabbix_agentd.conf | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | 設定が必要な項目は下記となります。 | ||
+ | |||
+ | ^ Item ^ Default ^ Info | | ||
+ | |LogFileSize| 0(v2.1.6 からは4) |ログファイル最大サイズ (MB)| | ||
+ | |EnableRemoteCommands| 0 |Zabbix server からのリモート制御 有効/無効| | ||
+ | |Server| 127.0.0.1 |Zabbix server の IPアドレスもしくはホスト名| | ||
+ | |ServerActive| 127.0.0.1 |アクティブチェックする Zabbix server のIPアドレス:ポート番号| | ||
+ | |Hostname| Zabbix server(v2.1.6 からは "MA-E3xx") |ホスト名| | ||
+ | |||
+ | \\ | ||
+ | |||
+ | Zabbix Agent を起動するかどうかの設定は、/etc/default/zabbix-agent にありますので、そちらも編集します。 | ||
+ | |||
+ | <code> | ||
+ | user1@plum:~$ sudo nano -w /etc/default/zabbix-agent | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | # defaults file for zabbix-agent | ||
+ | |||
+ | # Start the Zabbix on init? | ||
+ | # (Possible values: "yes" or "no") | ||
+ | START="no" | ||
+ | |||
+ | # Absolute path to the configuration file | ||
+ | CONFIG_FILE="/etc/zabbix/zabbix_agentd.conf" | ||
+ | </code> | ||
+ | |||
+ | "START=" の値を "yes" に変更します。 | ||
+ | |||
+ | \\ | ||
+ | |||
+ | === Zabbix-Agent の起動 === | ||
+ | |||
+ | service コマンドにより、Zabbix-Agent を起動します。 | ||
+ | |||
+ | <code> | ||
+ | user1@plum:~$ sudo service zabbix-agent start | ||
+ | zabbix-agent start/running, process 1930 | ||
+ | user1@plum:~$ | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | user1@plum:~$ ps ax | grep zabbix | ||
+ | 1930 ? S 0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf | ||
+ | 1933 ? S 0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec] | ||
+ | 1934 ? S 0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection] | ||
+ | 1936 ? S 0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection] | ||
+ | 1938 ? S 0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection] | ||
+ | 1939 ? S 0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec] | ||
+ | 1942 pts/0 S+ 0:00 grep --color=auto zabbix | ||
+ | user1@plum:~$ | ||
+ | </code> | ||
+ | |||
+ | ※ 次回起動以降は自動起動されます。 | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== Server 側の設定 ==== | ||
+ | |||
+ | MA-E3xx を、監視対象として登録します。\\ | ||
+ | テンプレートは、"Template OS Linux" を適用します。 | ||
+ | |||
+ | {{:mae3xx_tips:setup_zabbix_agent:zabbix_agent_01.png|テンプレートのリンク}} | ||
+ | |||
+ | \\ | ||
+ | |||
+ | しばらくすると、監視が開始され、データが蓄積されていることが確認できます。 | ||
+ | |||
+ | {{:mae3xx_tips:setup_zabbix_agent:zabbix_agent_02.png?700|CPU load のグラフ}} | ||
+ | |||
+ | {{:mae3xx_tips:setup_zabbix_agent:zabbix_agent_03.png?700|CPU 使用率のグラフ}} |