Ubuntu 14.04
Sponsored Link

Zabbix : インストール2016/01/13

 
統合監視システム Zabbix をインストールして設定します。
監視対象には Linux のみならず、Windows や Solaris、IBM の AIX なども一括で監視することができます。
[1]
[2]
[3]
[4] その他必要なパッケージ、および Zabbix のリポジトリを追加しておきます。
root@dlp:~#
apt-get -y install php5-mysql php5-gd php-xml-util php-net-socket php-gettext

root@dlp:~#
wget http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.4-1+trusty_all.deb

root@dlp:~#
dpkg -i zabbix-release_2.4-1+trusty_all.deb

root@dlp:~#
apt-get -y update
[5] Zabbix サーバーをインストールします。
Zabbix サーバー自身も監視できるよう、監視対象ホストに必要な Zabbix Agent も同時にインストールしておきます。
root@dlp:~#
apt-get -y install zabbix-get zabbix-server-mysql zabbix-frontend-php zabbix-agent
# No を選択して進む

 +--------------------+ Configuring zabbix-server-mysql +--------------------+
 |                                                                           |
 | The zabbix-server-mysql package must have a database installed and        |
 | configured before it can be used.  This can be optionally handled with    |
 | dbconfig-common.                                                          |
 |                                                                           |
 | If you are an advanced database administrator and know that you want to   |
 | perform this configuration manually, or if your database has already      |
 | been installed and configured, you should refuse this option.  Details    |
 | on what needs to be done should most likely be provided in                |
 | /usr/share/doc/zabbix-server-mysql.                                       |
 |                                                                           |
 | Otherwise, you should probably choose this option.                        |
 |                                                                           |
 | Configure database for zabbix-server-mysql with dbconfig-common?          |
 |                                                                           |
 |                    <Yes>                       <No>                       |
 |                                                                           |
 +---------------------------------------------------------------------------+
[6] データベースの設定をしておきます。
root@dlp:~#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 50
Server version: 5.5.46-MariaDB-1ubuntu0.14.04.2 (Ubuntu)

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
create database zabbix;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to zabbix@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to zabbix@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
root@dlp:~#
cd /usr/share/zabbix-server-mysql

root@dlp:/usr/share/zabbix-server-mysql#
mysql -u root -p zabbix < schema.sql

Enter password:
root@dlp:/usr/share/zabbix-server-mysql#
mysql -u root -p zabbix < images.sql

Enter password:
root@dlp:/usr/share/zabbix-server-mysql#
mysql -u root -p zabbix < data.sql

Enter password:
[7] Zabbix サーバーを設定して起動します。
root@dlp:~#
vi /etc/zabbix/zabbix_server.conf
# 84行目:DB名を追記

DBName=
zabbix
# 84行目:DBユーザー名を追記

DBUser=
zabbix
# 100行目:DBユーザーのパスワードを追記

DBPassword=
password
root@dlp:~#
/etc/init.d/zabbix-server start

* Starting Zabbix server zabbix_server
...done.
[8] Zabbix サーバー自身も監視できるよう Zabbix Agent を設定して起動します。
root@dlp:~#
vi /etc/zabbix/zabbix_agentd.conf
# 137行目:自身のホスト名に変更

Hostname=
dlp.srv.world
root@dlp:~#
/etc/init.d/zabbix-agent start

* Starting Zabbix agent zabbix_agentd
...done.
[9] httpd の設定を変更しておきます。以上で Zabbix サーバーの基本設定は完了です。
root@dlp:~#
vi /etc/zabbix/apache.conf
# 10行目:Web フロントエンドにアクセス許可する範囲を変更

Allow from
127.0.0.1 10.0.0.10/24
# 18行目:コメント解除し自身のタイムゾーンに変更

php_value date.timezone
Asia/Tokyo
root@dlp:~#
/etc/init.d/apache2 restart

* Restarting web server apache2
...done.
関連コンテンツ