Zabbixインストール

先日導入したmonitを重宝しているのですが、
もう少し高度な監視を行うためにZabbixの導入を検討中です。
試験的にインストールしてみました。

# yum -y install zabbix22 zabbix22-web zabbix22-agent zabbix22-serv
er
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* rpmforge: ftp.kddilabs.jp
* updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package zabbix22.x86_64 0:2.2.7-1.el7 will be installed
---> Package zabbix22-agent.x86_64 0:2.2.7-1.el7 will be installed
---> Package zabbix22-server.noarch 0:2.2.7-1.el7 will be installed
--> Processing Dependency: zabbix22-server-implementation = 2.2.7-1.el7 for package: zabbix22-server-2.2.7-1.el7.noarch
--> Processing Dependency: traceroute for package: zabbix22-server-2.2.7-1.el7.noarch
--> Processing Dependency: fping for package: zabbix22-server-2.2.7-1.el7.noarch
---> Package zabbix22-web.noarch 0:2.2.7-1.el7 will be installed
--> Processing Dependency: zabbix22-web-database = 2.2.7-1.el7 for package: zabbix22-web-2.2.7-1.el7.noarch
--> Processing Dependency: php-ldap for package: zabbix22-web-2.2.7-1.el7.noarch
--> Processing Dependency: php-gd for package: zabbix22-web-2.2.7-1.el7.noarch
--> Processing Dependency: php-bcmath for package: zabbix22-web-2.2.7-1.el7.noarch
--> Processing Dependency: dejavu-sans-fonts for package: zabbix22-web-2.2.7-1.el7.noarch
--> Running transaction check
---> Package dejavu-sans-fonts.noarch 0:2.33-6.el7 will be installed
--> Processing Dependency: dejavu-fonts-common = 2.33-6.el7 for package: dejavu-sans-fonts-2.33-6.el7.noarch
---> Package fping.x86_64 0:3.10-1.el7.rf will be installed
---> Package php-bcmath.x86_64 0:5.4.16-23.el7_0.3 will be installed
---> Package php-gd.x86_64 0:5.4.16-23.el7_0.3 will be installed
--> Processing Dependency: libt1.so.5()(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64
---> Package php-ldap.x86_64 0:5.4.16-23.el7_0.3 will be installed
---> Package traceroute.x86_64 3:2.0.19-5.el7 will be installed
---> Package zabbix22-server-mysql.x86_64 0:2.2.7-1.el7 will be installed
--> Processing Dependency: zabbix22-dbfiles-mysql for package: zabbix22-server-mysql-2.2.7-1.el7.x86_64
--> Processing Dependency: libodbc.so.2()(64bit) for package: zabbix22-server-mysql-2.2.7-1.el7.x86_64
--> Processing Dependency: libnetsnmp.so.31()(64bit) for package: zabbix22-server-mysql-2.2.7-1.el7.x86_64
--> Processing Dependency: libiksemel.so.3()(64bit) for package: zabbix22-server-mysql-2.2.7-1.el7.x86_64
--> Processing Dependency: libOpenIPMIposix.so.0()(64bit) for package: zabbix22-server-mysql-2.2.7-1.el7.x86_64
--> Processing Dependency: libOpenIPMI.so.0()(64bit) for package: zabbix22-server-mysql-2.2.7-1.el7.x86_64
---> Package zabbix22-web-mysql.noarch 0:2.2.7-1.el7 will be installed
--> Running transaction check
---> Package OpenIPMI-libs.x86_64 0:2.0.19-11.el7 will be installed
--> Processing Dependency: OpenIPMI-modalias = 2.0.19-11.el7 for package: OpenIPMI-libs-2.0.19-11.el7.x86_64
---> Package dejavu-fonts-common.noarch 0:2.33-6.el7 will be installed
---> Package iksemel.x86_64 0:1.4-6.el7 will be installed
---> Package libXpm.x86_64 0:3.5.10-5.1.el7 will be installed
---> Package net-snmp-libs.x86_64 1:5.7.2-18.el7 will be installed
---> Package t1lib.x86_64 0:5.1.2-14.el7 will be installed
---> Package unixODBC.x86_64 0:2.3.1-10.el7 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.3.1-10.el7.x86_64
---> Package zabbix22-dbfiles-mysql.noarch 0:2.2.7-1.el7 will be installed
--> Running transaction check
---> Package OpenIPMI-modalias.x86_64 0:2.0.19-11.el7 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-20.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package                    Arch       Version               Repository    Size
================================================================================
Installing:
zabbix22                   x86_64     2.2.7-1.el7           epel         212 k
zabbix22-agent             x86_64     2.2.7-1.el7           epel         165 k
zabbix22-server            noarch     2.2.7-1.el7           epel          21 k
zabbix22-web               noarch     2.2.7-1.el7           epel         3.4 M
Installing for dependencies:
OpenIPMI-libs              x86_64     2.0.19-11.el7         base         501 k
OpenIPMI-modalias          x86_64     2.0.19-11.el7         base          15 k
dejavu-fonts-common        noarch     2.33-6.el7            base          64 k
dejavu-sans-fonts          noarch     2.33-6.el7            base         1.4 M
fping                      x86_64     3.10-1.el7.rf         rpmforge      55 k
iksemel                    x86_64     1.4-6.el7             epel          50 k
libXpm                     x86_64     3.5.10-5.1.el7        base          52 k
libtool-ltdl               x86_64     2.4.2-20.el7          base          49 k
net-snmp-libs              x86_64     1:5.7.2-18.el7        base         744 k
php-bcmath                 x86_64     5.4.16-23.el7_0.3     updates       54 k
php-gd                     x86_64     5.4.16-23.el7_0.3     updates      124 k
php-ldap                   x86_64     5.4.16-23.el7_0.3     updates       49 k
t1lib                      x86_64     5.1.2-14.el7          base         166 k
traceroute                 x86_64     3:2.0.19-5.el7        base          58 k
unixODBC                   x86_64     2.3.1-10.el7          base         413 k
zabbix22-dbfiles-mysql     noarch     2.2.7-1.el7           epel         1.1 M
zabbix22-server-mysql      x86_64     2.2.7-1.el7           epel         436 k
zabbix22-web-mysql         noarch     2.2.7-1.el7           epel          11 k

Transaction Summary
================================================================================
Install  4 Packages (+18 Dependent packages)

Total download size: 9.0 M
Installed size: 44 M
Downloading packages:
(1/22): OpenIPMI-modalias-2.0.19-11.el7.x86_64.rpm         |  15 kB   00:00
(2/22): dejavu-fonts-common-2.33-6.el7.noarch.rpm          |  64 kB   00:00
(3/22): OpenIPMI-libs-2.0.19-11.el7.x86_64.rpm             | 501 kB   00:00
(4/22): libXpm-3.5.10-5.1.el7.x86_64.rpm                   |  52 kB   00:00
(5/22): libtool-ltdl-2.4.2-20.el7.x86_64.rpm               |  49 kB   00:00
(6/22): net-snmp-libs-5.7.2-18.el7.x86_64.rpm              | 744 kB   00:00
(7/22): dejavu-sans-fonts-2.33-6.el7.noarch.rpm            | 1.4 MB   00:00
(8/22): fping-3.10-1.el7.rf.x86_64.rpm                     |  55 kB   00:00
(9/22): php-gd-5.4.16-23.el7_0.3.x86_64.rpm                | 124 kB   00:00
(10/22): php-bcmath-5.4.16-23.el7_0.3.x86_64.rpm           |  54 kB   00:00
(11/22): iksemel-1.4-6.el7.x86_64.rpm                      |  50 kB   00:00
(12/22): php-ldap-5.4.16-23.el7_0.3.x86_64.rpm             |  49 kB   00:00
(13/22): traceroute-2.0.19-5.el7.x86_64.rpm                |  58 kB   00:00
(14/22): unixODBC-2.3.1-10.el7.x86_64.rpm                  | 413 kB   00:00
(15/22): t1lib-5.1.2-14.el7.x86_64.rpm                     | 166 kB   00:01
(16/22): zabbix22-2.2.7-1.el7.x86_64.rpm                   | 212 kB   00:00
(17/22): zabbix22-agent-2.2.7-1.el7.x86_64.rpm             | 165 kB   00:00
(18/22): zabbix22-dbfiles-mysql-2.2.7-1.el7.noarch.rpm     | 1.1 MB   00:01
(19/22): zabbix22-server-2.2.7-1.el7.noarch.rpm            |  21 kB   00:00
(20/22): zabbix22-server-mysql-2.2.7-1.el7.x86_64.rpm      | 436 kB   00:00
(21/22): zabbix22-web-2.2.7-1.el7.noarch.rpm               | 3.4 MB   00:00
(22/22): zabbix22-web-mysql-2.2.7-1.el7.noarch.rpm         |  11 kB   00:00
--------------------------------------------------------------------------------
Total                                              2.0 MB/s | 9.0 MB  00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : zabbix22-2.2.7-1.el7.x86_64                                 1/22
Installing : iksemel-1.4-6.el7.x86_64                                    2/22
Installing : php-bcmath-5.4.16-23.el7_0.3.x86_64                         3/22
Installing : 3:traceroute-2.0.19-5.el7.x86_64                            4/22
Installing : t1lib-5.1.2-14.el7.x86_64                                   5/22
Installing : OpenIPMI-modalias-2.0.19-11.el7.x86_64                      6/22
Installing : OpenIPMI-libs-2.0.19-11.el7.x86_64                          7/22
Installing : 1:net-snmp-libs-5.7.2-18.el7.x86_64                         8/22
Installing : dejavu-fonts-common-2.33-6.el7.noarch                       9/22
Installing : dejavu-sans-fonts-2.33-6.el7.noarch                        10/22
Installing : fping-3.10-1.el7.rf.x86_64                                 11/22
Installing : php-ldap-5.4.16-23.el7_0.3.x86_64                          12/22
Installing : zabbix22-dbfiles-mysql-2.2.7-1.el7.noarch                  13/22
Installing : libXpm-3.5.10-5.1.el7.x86_64                               14/22
Installing : php-gd-5.4.16-23.el7_0.3.x86_64                            15/22
Installing : zabbix22-web-mysql-2.2.7-1.el7.noarch                      16/22
Installing : zabbix22-web-2.2.7-1.el7.noarch                            17/22
Installing : libtool-ltdl-2.4.2-20.el7.x86_64                           18/22
Installing : unixODBC-2.3.1-10.el7.x86_64                               19/22
Installing : zabbix22-server-mysql-2.2.7-1.el7.x86_64                   20/22
Installing : zabbix22-server-2.2.7-1.el7.noarch                         21/22
Installing : zabbix22-agent-2.2.7-1.el7.x86_64                          22/22
Verifying  : zabbix22-2.2.7-1.el7.x86_64                                 1/22
Verifying  : libtool-ltdl-2.4.2-20.el7.x86_64                            2/22
Verifying  : php-gd-5.4.16-23.el7_0.3.x86_64                             3/22
Verifying  : libXpm-3.5.10-5.1.el7.x86_64                                4/22
Verifying  : zabbix22-dbfiles-mysql-2.2.7-1.el7.noarch                   5/22
Verifying  : OpenIPMI-libs-2.0.19-11.el7.x86_64                          6/22
Verifying  : zabbix22-agent-2.2.7-1.el7.x86_64                           7/22
Verifying  : zabbix22-web-mysql-2.2.7-1.el7.noarch                       8/22
Verifying  : php-ldap-5.4.16-23.el7_0.3.x86_64                           9/22
Verifying  : fping-3.10-1.el7.rf.x86_64                                 10/22
Verifying  : dejavu-fonts-common-2.33-6.el7.noarch                      11/22
Verifying  : 1:net-snmp-libs-5.7.2-18.el7.x86_64                        12/22
Verifying  : OpenIPMI-modalias-2.0.19-11.el7.x86_64                     13/22
Verifying  : zabbix22-server-mysql-2.2.7-1.el7.x86_64                   14/22
Verifying  : t1lib-5.1.2-14.el7.x86_64                                  15/22
Verifying  : 3:traceroute-2.0.19-5.el7.x86_64                           16/22
Verifying  : unixODBC-2.3.1-10.el7.x86_64                               17/22
Verifying  : dejavu-sans-fonts-2.33-6.el7.noarch                        18/22
Verifying  : zabbix22-server-2.2.7-1.el7.noarch                         19/22
Verifying  : zabbix22-web-2.2.7-1.el7.noarch                            20/22
Verifying  : php-bcmath-5.4.16-23.el7_0.3.x86_64                        21/22
Verifying  : iksemel-1.4-6.el7.x86_64                                   22/22

Installed:
zabbix22.x86_64 0:2.2.7-1.el7           zabbix22-agent.x86_64 0:2.2.7-1.el7
zabbix22-server.noarch 0:2.2.7-1.el7    zabbix22-web.noarch 0:2.2.7-1.el7

Dependency Installed:
OpenIPMI-libs.x86_64 0:2.0.19-11.el7
OpenIPMI-modalias.x86_64 0:2.0.19-11.el7
dejavu-fonts-common.noarch 0:2.33-6.el7
dejavu-sans-fonts.noarch 0:2.33-6.el7
fping.x86_64 0:3.10-1.el7.rf
iksemel.x86_64 0:1.4-6.el7
libXpm.x86_64 0:3.5.10-5.1.el7
libtool-ltdl.x86_64 0:2.4.2-20.el7
net-snmp-libs.x86_64 1:5.7.2-18.el7
php-bcmath.x86_64 0:5.4.16-23.el7_0.3
php-gd.x86_64 0:5.4.16-23.el7_0.3
php-ldap.x86_64 0:5.4.16-23.el7_0.3
t1lib.x86_64 0:5.1.2-14.el7
traceroute.x86_64 3:2.0.19-5.el7
unixODBC.x86_64 0:2.3.1-10.el7
zabbix22-dbfiles-mysql.noarch 0:2.2.7-1.el7
zabbix22-server-mysql.x86_64 0:2.2.7-1.el7
zabbix22-web-mysql.noarch 0:2.2.7-1.el7

Complete!
# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 608
Server version: 5.5.40-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

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

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all on zabbix.* to 'zabbix'@'localhost' identified by 'Password';
Query OK, 0 rows affected (0.05 sec)

MariaDB [(none)]> exit
Bye
# mysql -uzabbix -pPassword zabbix < /usr/share/zabbix-mysql/
schema.sql
[root@ciel ~]# mysql -uzabbix -pPassword zabbix < /usr/share/zabbix-mysql/
images.sql
[root@ciel ~]# mysql -uzabbix -pPassword zabbix < /usr/share/zabbix-mysql/
data.sql
# vi /etc/zabbix/zabbix_server.conf
DBPassword=Password
# vi /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value post_max_size 16M
php_value max_input_time 300
# systemctl start zabbix-agent
# systemctl start zabbix-server-mysql
# systemctl enable zabbix-agent
ln -s '/usr/lib/systemd/system/zabbix-agent.service' '/etc/systemd/system/multi-user.target.wants/zabbix-agent.service'
# systemctl enable zabbix-server-mysql
ln -s '/usr/lib/systemd/system/zabbix-server-mysql.service' '/etc/systemd/system/multi-user.target.wants/zabbix-server-mysql.service'
# vi /etc/php.ini
date.timezone = Asia/Tokyo
# systemctl restart httpd

「http://IPアドレス/zabbix/」からWebGUIによるインストールが行えます。

http://qiita.com/tukiyo3/items/e974627fbb393037fa8a

http://knowledge.sakura.ad.jp/tech/585/2/