Zabbix的官方网站的下载页是:
http://www.zabbix.com/download
最新版本3.2的YUM源页面为:
http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/
ZABBIX官方的维基百科:
http://zabbix.org/wiki/
ZABBIX官方的安装手册:
http://zabbix.org/wiki/InstallOnCentOS_RHEL
ZABBIX官方的仓库:
http://repo.zabbix.com/zabbix/
下面,本文会完全按照官方文档,在CENTOS上面,部署一遍ZABBIX 3.2。
一、操作系统
发行版与内核版本
[root@zabbix-me ~]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) [root@zabbix-me ~]# [root@zabbix-me ~]# uname -a Linux zabbix-me 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [root@zabbix-me ~]#
二、EPEL
URL:
http://blog.zabbix.com/zabbix-2-0-packages-for-rhel-centos-sl/1893/
http://fedoraproject.org/wiki/EPEL
http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F
If you are running an EL7 version, please visit here to get the newest ‘epel-release’ package for EL7: The newest version of ‘epel-release’ for EL7
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
If you are running an EL6 version, please visit here to get the newest ‘epel-release’ package for EL6: The newest version of ‘epel-release’ for EL6
https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
If you are running an EL5 version, please visit here to get the newest ‘epel-release’ package for EL5: The newest version of ‘epel-release’ for EL5
https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
详情:
[root@zabbix-me ~]# mkdir /software [root@zabbix-me ~]# cd /software/ [root@zabbix-me software]# [root@zabbix-me software]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm --2017-02-24 15:48:09-- https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.24, 209.132.181.26, 209.132.181.25, ... Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.24|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 14704 (14K) [application/x-rpm] Saving to: ‘epel-release-latest-7.noarch.rpm’ 100%[======================================================================================================================================>] 14,704 18.2KB/s in 0.8s 2017-02-24 15:48:11 (18.2 KB/s) - ‘epel-release-latest-7.noarch.rpm’ saved [14704/14704] [root@zabbix-me software]# [root@zabbix-me software]# ls -ltr total 16 -rw-r--r-- 1 root root 14704 Dec 28 01:40 epel-release-latest-7.noarch.rpm [root@zabbix-me software]# [root@zabbix-me software]# ls -ltr /etc/yum.repos.d/ total 28 -rw-r--r--. 1 root root 1002 Apr 1 2015 CentOS-Vault.repo -rw-r--r--. 1 root root 1331 Apr 1 2015 CentOS-Sources.repo -rw-r--r--. 1 root root 290 Apr 1 2015 CentOS-fasttrack.repo -rw-r--r--. 1 root root 649 Apr 1 2015 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 1309 Apr 1 2015 CentOS-CR.repo -rw-r--r--. 1 root root 1664 Apr 1 2015 CentOS-Base.repo -rw-r--r--. 1 root root 384 Feb 24 11:09 rhel7.repo [root@zabbix-me software]# [root@zabbix-me software]# rpm -ivh epel-release-latest-7.noarch.rpm warning: epel-release-latest-7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:epel-release-7-9 ################################# [100%] [root@zabbix-me software]# [root@zabbix-me software]# ls -ltr /etc/yum.repos.d/ total 36 -rw-r--r--. 1 root root 1002 Apr 1 2015 CentOS-Vault.repo -rw-r--r--. 1 root root 1331 Apr 1 2015 CentOS-Sources.repo -rw-r--r--. 1 root root 290 Apr 1 2015 CentOS-fasttrack.repo -rw-r--r--. 1 root root 649 Apr 1 2015 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 1309 Apr 1 2015 CentOS-CR.repo -rw-r--r--. 1 root root 1664 Apr 1 2015 CentOS-Base.repo -rw-r--r-- 1 root root 1056 Dec 28 01:37 epel-testing.repo -rw-r--r-- 1 root root 957 Dec 28 01:37 epel.repo -rw-r--r--. 1 root root 384 Feb 24 11:09 rhel7.repo [root@zabbix-me software]# [root@zabbix-me software]# [root@zabbix-me software]# yum repolist Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.cn99.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.cn99.com * updates: mirrors.cn99.com epel/x86_64/primary_db | 4.5 MB 00:00:36 repo id repo name status ISO ISO 8,652 base/7/x86_64 CentOS-7 - Base 9,363 epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 11,239 extras/7/x86_64 CentOS-7 - Extras 264 updates/7/x86_64 CentOS-7 - Updates 856 repolist: 30,374 [root@zabbix-me software]#
三、ZABBIX-RELEASE
最新版本的RELEASE安装包:
http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
详细:
[root@zabbix-me software]# wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm --2017-02-24 15:56:25-- http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm Resolving repo.zabbix.com (repo.zabbix.com)... 162.243.159.138 Connecting to repo.zabbix.com (repo.zabbix.com)|162.243.159.138|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 13392 (13K) [application/x-redhat-package-manager] Saving to: ‘zabbix-release-3.2-1.el7.noarch.rpm’ 100%[======================================================================================================================================>] 13,392 --.-K/s in 0.004s 2017-02-24 15:56:26 (3.55 MB/s) - ‘zabbix-release-3.2-1.el7.noarch.rpm’ saved [13392/13392] [root@zabbix-me software]# [root@zabbix-me software]# ls -ltr total 32 -rw-r--r-- 1 root root 13392 Sep 14 20:00 zabbix-release-3.2-1.el7.noarch.rpm -rw-r--r-- 1 root root 14704 Dec 28 01:40 epel-release-latest-7.noarch.rpm [root@zabbix-me software]# [root@zabbix-me software]# ls -ltr /etc/yum.repos.d/ total 36 -rw-r--r--. 1 root root 1002 Apr 1 2015 CentOS-Vault.repo -rw-r--r--. 1 root root 1331 Apr 1 2015 CentOS-Sources.repo -rw-r--r--. 1 root root 290 Apr 1 2015 CentOS-fasttrack.repo -rw-r--r--. 1 root root 649 Apr 1 2015 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 1309 Apr 1 2015 CentOS-CR.repo -rw-r--r--. 1 root root 1664 Apr 1 2015 CentOS-Base.repo -rw-r--r-- 1 root root 1056 Dec 28 01:37 epel-testing.repo -rw-r--r-- 1 root root 957 Dec 28 01:37 epel.repo -rw-r--r--. 1 root root 384 Feb 24 11:09 rhel7.repo [root@zabbix-me software]# [root@zabbix-me software]# rpm -ivh zabbix-release-3.2-1.el7.noarch.rpm warning: zabbix-release-3.2-1.el7.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY Preparing... ################################# [100%] Updating / installing... 1:zabbix-release-3.2-1.el7 ################################# [100%] [root@zabbix-me software]# [root@zabbix-me software]# ls -ltr /etc/yum.repos.d/ total 40 -rw-r--r--. 1 root root 1002 Apr 1 2015 CentOS-Vault.repo -rw-r--r--. 1 root root 1331 Apr 1 2015 CentOS-Sources.repo -rw-r--r--. 1 root root 290 Apr 1 2015 CentOS-fasttrack.repo -rw-r--r--. 1 root root 649 Apr 1 2015 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 1309 Apr 1 2015 CentOS-CR.repo -rw-r--r--. 1 root root 1664 Apr 1 2015 CentOS-Base.repo -rw-r--r-- 1 root root 410 Sep 14 19:59 zabbix.repo -rw-r--r-- 1 root root 1056 Dec 28 01:37 epel-testing.repo -rw-r--r-- 1 root root 957 Dec 28 01:37 epel.repo -rw-r--r--. 1 root root 384 Feb 24 11:09 rhel7.repo [root@zabbix-me software]# [root@zabbix-me software]# yum repolist Loaded plugins: fastestmirror, langpacks zabbix | 951 B 00:00:00 zabbix-non-supported | 951 B 00:00:00 (1/2): zabbix-non-supported/x86_64/primary | 1.6 kB 00:00:01 (2/2): zabbix/x86_64/primary | 8.2 kB 00:00:02 Loading mirror speeds from cached hostfile * base: mirrors.cn99.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.cn99.com * updates: mirrors.cn99.com zabbix 53/53 zabbix-non-supported 4/4 repo id repo name status ISO ISO 8,652 base/7/x86_64 CentOS-7 - Base 9,363 epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 11,239 extras/7/x86_64 CentOS-7 - Extras 264 updates/7/x86_64 CentOS-7 - Updates 856 zabbix/x86_64 Zabbix Official Repository - x86_64 53 zabbix-non-supported/x86_64 Zabbix Official Repository non-supported - x86_64 4 repolist: 30,431 [root@zabbix-me software]#
四、安装
详细:
[root@zabbix-me software]# yum list | grep --color zabbix zabbix-release.noarch 3.2-1.el7 installed pcp-export-zabbix-agent.x86_64 3.11.3-4.el7 base python-pyzabbix.noarch 0.7.3-2.el7 epel uwsgi-stats-pusher-zabbix.x86_64 2.0.14-6.el7 epel zabbix-agent.x86_64 3.2.3-1.el7 zabbix zabbix-get.x86_64 3.2.3-1.el7 zabbix zabbix-java-gateway.x86_64 3.2.3-1.el7 zabbix zabbix-proxy-mysql.x86_64 3.2.3-1.el7 zabbix zabbix-proxy-pgsql.x86_64 3.2.3-1.el7 zabbix zabbix-proxy-sqlite3.x86_64 3.2.3-1.el7 zabbix zabbix-sender.x86_64 3.2.3-1.el7 zabbix zabbix-server-mysql.x86_64 3.2.3-1.el7 zabbix zabbix-server-pgsql.x86_64 3.2.3-1.el7 zabbix zabbix-web.noarch 3.2.3-1.el7 zabbix zabbix-web-japanese.noarch 3.2.3-1.el7 zabbix zabbix-web-mysql.noarch 3.2.3-1.el7 zabbix zabbix-web-pgsql.noarch 3.2.3-1.el7 zabbix zabbix20.x86_64 2.0.20-1.el7 epel zabbix20-agent.x86_64 2.0.20-1.el7 epel zabbix20-proxy.noarch 2.0.20-1.el7 epel zabbix20-proxy-mysql.x86_64 2.0.20-1.el7 epel zabbix20-proxy-pgsql.x86_64 2.0.20-1.el7 epel zabbix20-proxy-sqlite3.x86_64 2.0.20-1.el7 epel zabbix20-server.noarch 2.0.20-1.el7 epel zabbix20-server-mysql.x86_64 2.0.20-1.el7 epel zabbix20-server-pgsql.x86_64 2.0.20-1.el7 epel zabbix20-web.noarch 2.0.20-1.el7 epel zabbix20-web-mysql.noarch 2.0.20-1.el7 epel zabbix20-web-pgsql.noarch 2.0.20-1.el7 epel zabbix22.x86_64 2.2.16-1.el7 epel zabbix22-agent.x86_64 2.2.16-1.el7 epel zabbix22-dbfiles-mysql.noarch 2.2.16-1.el7 epel zabbix22-dbfiles-pgsql.noarch 2.2.16-1.el7 epel zabbix22-dbfiles-sqlite3.noarch 2.2.16-1.el7 epel zabbix22-proxy.noarch 2.2.16-1.el7 epel zabbix22-proxy-mysql.x86_64 2.2.16-1.el7 epel zabbix22-proxy-pgsql.x86_64 2.2.16-1.el7 epel zabbix22-proxy-sqlite3.x86_64 2.2.16-1.el7 epel zabbix22-server.noarch 2.2.16-1.el7 epel zabbix22-server-mysql.x86_64 2.2.16-1.el7 epel zabbix22-server-pgsql.x86_64 2.2.16-1.el7 epel zabbix22-web.noarch 2.2.16-1.el7 epel zabbix22-web-mysql.noarch 2.2.16-1.el7 epel zabbix22-web-pgsql.noarch 2.2.16-1.el7 epel [root@zabbix-me software]# [root@zabbix-me software]# yum install zabbix-agent zabbix-server-mysql zabbix-web zabbix-web-mysql Loaded plugins: fastestmirror, langpacks ISO | 3.6 kB 00:00:00 base | 3.6 kB 00:00:00 epel/x86_64/metalink | 4.7 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 zabbix | 951 B 00:00:00 zabbix-non-supported | 951 B 00:00:00 Loading mirror speeds from cached hostfile * base: mirrors.cn99.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.cn99.com * updates: mirrors.cn99.com Resolving Dependencies --> Running transaction check ---> Package zabbix-agent.x86_64 0:3.2.3-1.el7 will be installed ---> Package zabbix-server-mysql.x86_64 0:3.2.3-1.el7 will be installed --> Processing Dependency: fping for package: zabbix-server-mysql-3.2.3-1.el7.x86_64 --> Processing Dependency: libiksemel.so.3()(64bit) for package: zabbix-server-mysql-3.2.3-1.el7.x86_64 --> Processing Dependency: libOpenIPMIposix.so.0()(64bit) for package: zabbix-server-mysql-3.2.3-1.el7.x86_64 --> Processing Dependency: libodbc.so.2()(64bit) for package: zabbix-server-mysql-3.2.3-1.el7.x86_64 --> Processing Dependency: libOpenIPMI.so.0()(64bit) for package: zabbix-server-mysql-3.2.3-1.el7.x86_64 ---> Package zabbix-web.noarch 0:3.2.3-1.el7 will be installed --> Processing Dependency: php >= 5.4 for package: zabbix-web-3.2.3-1.el7.noarch --> Processing Dependency: php-gd for package: zabbix-web-3.2.3-1.el7.noarch --> Processing Dependency: php-mbstring for package: zabbix-web-3.2.3-1.el7.noarch --> Processing Dependency: php-bcmath for package: zabbix-web-3.2.3-1.el7.noarch --> Processing Dependency: httpd for package: zabbix-web-3.2.3-1.el7.noarch --> Processing Dependency: php-ldap for package: zabbix-web-3.2.3-1.el7.noarch --> Processing Dependency: php-xml for package: zabbix-web-3.2.3-1.el7.noarch ---> Package zabbix-web-mysql.noarch 0:3.2.3-1.el7 will be installed --> Processing Dependency: php-mysql for package: zabbix-web-mysql-3.2.3-1.el7.noarch --> Running transaction check ---> Package OpenIPMI-libs.x86_64 0:2.0.19-15.el7 will be installed --> Processing Dependency: OpenIPMI-modalias = 2.0.19-15.el7 for package: OpenIPMI-libs-2.0.19-15.el7.x86_64 ---> Package fping.x86_64 0:3.10-4.el7 will be installed ---> Package httpd.x86_64 0:2.4.6-45.el7.centos will be installed --> Processing Dependency: httpd-tools = 2.4.6-45.el7.centos for package: httpd-2.4.6-45.el7.centos.x86_64 --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-45.el7.centos.x86_64 --> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-45.el7.centos.x86_64 --> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-45.el7.centos.x86_64 ---> Package iksemel.x86_64 0:1.4-6.el7 will be installed ---> Package php.x86_64 0:5.4.16-42.el7 will be installed --> Processing Dependency: php-common(x86-64) = 5.4.16-42.el7 for package: php-5.4.16-42.el7.x86_64 --> Processing Dependency: php-cli(x86-64) = 5.4.16-42.el7 for package: php-5.4.16-42.el7.x86_64 ---> Package php-bcmath.x86_64 0:5.4.16-42.el7 will be installed ---> Package php-gd.x86_64 0:5.4.16-42.el7 will be installed --> Processing Dependency: libt1.so.5()(64bit) for package: php-gd-5.4.16-42.el7.x86_64 ---> Package php-ldap.x86_64 0:5.4.16-42.el7 will be installed ---> Package php-mbstring.x86_64 0:5.4.16-42.el7 will be installed ---> Package php-mysql.x86_64 0:5.4.16-42.el7 will be installed --> Processing Dependency: php-pdo(x86-64) = 5.4.16-42.el7 for package: php-mysql-5.4.16-42.el7.x86_64 ---> Package php-xml.x86_64 0:5.4.16-42.el7 will be installed ---> Package unixODBC.x86_64 0:2.3.1-11.el7 will be installed --> Running transaction check ---> Package OpenIPMI-modalias.x86_64 0:2.0.19-15.el7 will be installed ---> Package apr.x86_64 0:1.4.8-3.el7 will be installed ---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed ---> Package httpd-tools.x86_64 0:2.4.6-45.el7.centos will be installed ---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed ---> Package php-cli.x86_64 0:5.4.16-42.el7 will be installed ---> Package php-common.x86_64 0:5.4.16-42.el7 will be installed --> Processing Dependency: libzip.so.2()(64bit) for package: php-common-5.4.16-42.el7.x86_64 ---> Package php-pdo.x86_64 0:5.4.16-42.el7 will be installed ---> Package t1lib.x86_64 0:5.1.2-14.el7 will be installed --> Running transaction check ---> Package libzip.x86_64 0:0.10.1-8.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================================================================ Installing: zabbix-agent x86_64 3.2.3-1.el7 zabbix 338 k zabbix-server-mysql x86_64 3.2.3-1.el7 zabbix 1.8 M zabbix-web noarch 3.2.3-1.el7 zabbix 3.6 M zabbix-web-mysql noarch 3.2.3-1.el7 zabbix 5.3 k Installing for dependencies: OpenIPMI-libs x86_64 2.0.19-15.el7 base 502 k OpenIPMI-modalias x86_64 2.0.19-15.el7 base 15 k apr x86_64 1.4.8-3.el7 ISO 103 k apr-util x86_64 1.5.2-6.el7 ISO 92 k fping x86_64 3.10-4.el7 epel 46 k httpd x86_64 2.4.6-45.el7.centos base 2.7 M httpd-tools x86_64 2.4.6-45.el7.centos base 84 k iksemel x86_64 1.4-6.el7 epel 50 k libzip x86_64 0.10.1-8.el7 ISO 48 k mailcap noarch 2.1.41-2.el7 ISO 31 k php x86_64 5.4.16-42.el7 base 1.4 M php-bcmath x86_64 5.4.16-42.el7 base 57 k php-cli x86_64 5.4.16-42.el7 base 2.7 M php-common x86_64 5.4.16-42.el7 base 564 k php-gd x86_64 5.4.16-42.el7 base 127 k php-ldap x86_64 5.4.16-42.el7 base 52 k php-mbstring x86_64 5.4.16-42.el7 base 505 k php-mysql x86_64 5.4.16-42.el7 base 101 k php-pdo x86_64 5.4.16-42.el7 base 98 k php-xml x86_64 5.4.16-42.el7 base 125 k t1lib x86_64 5.1.2-14.el7 ISO 166 k unixODBC x86_64 2.3.1-11.el7 base 413 k Transaction Summary ================================================================================================================================================================================ Install 4 Packages (+22 Dependent packages) Total download size: 16 M Installed size: 69 M Is this ok [y/d/N]: y Downloading packages: warning: /var/cache/yum/x86_64/7/base/packages/OpenIPMI-modalias-2.0.19-15.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY0.0 B/s | 387 kB --:--:-- ETA Public key for OpenIPMI-modalias-2.0.19-15.el7.x86_64.rpm is not installed (1/26): OpenIPMI-modalias-2.0.19-15.el7.x86_64.rpm | 15 kB 00:00:00 (2/26): OpenIPMI-libs-2.0.19-15.el7.x86_64.rpm | 502 kB 00:00:00 (3/26): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:00 (4/26): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:00 (5/26): httpd-tools-2.4.6-45.el7.centos.x86_64.rpm | 84 kB 00:00:00 (6/26): libzip-0.10.1-8.el7.x86_64.rpm | 48 kB 00:00:00 (7/26): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00 warning: /var/cache/yum/x86_64/7/epel/packages/fping-3.10-4.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY Public key for fping-3.10-4.el7.x86_64.rpm is not installed (8/26): fping-3.10-4.el7.x86_64.rpm | 46 kB 00:00:01 (9/26): iksemel-1.4-6.el7.x86_64.rpm | 50 kB 00:00:01 (10/26): php-5.4.16-42.el7.x86_64.rpm | 1.4 MB 00:00:02 (11/26): php-bcmath-5.4.16-42.el7.x86_64.rpm | 57 kB 00:00:00 (12/26): httpd-2.4.6-45.el7.centos.x86_64.rpm | 2.7 MB 00:00:05 (13/26): php-ldap-5.4.16-42.el7.x86_64.rpm | 52 kB 00:00:00 (14/26): php-gd-5.4.16-42.el7.x86_64.rpm | 127 kB 00:00:00 (15/26): php-mysql-5.4.16-42.el7.x86_64.rpm | 101 kB 00:00:00 (16/26): php-xml-5.4.16-42.el7.x86_64.rpm | 125 kB 00:00:00 (17/26): php-pdo-5.4.16-42.el7.x86_64.rpm | 98 kB 00:00:00 (18/26): t1lib-5.1.2-14.el7.x86_64.rpm | 166 kB 00:00:00 (19/26): php-common-5.4.16-42.el7.x86_64.rpm | 564 kB 00:00:01 (20/26): php-mbstring-5.4.16-42.el7.x86_64.rpm | 505 kB 00:00:03 (21/26): php-cli-5.4.16-42.el7.x86_64.rpm | 2.7 MB 00:00:05 (22/26): unixODBC-2.3.1-11.el7.x86_64.rpm | 413 kB 00:00:02 warning: /var/cache/yum/x86_64/7/zabbix/packages/zabbix-agent-3.2.3-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY ] 26 kB/s | 10 MB 00:03:24 ETA Public key for zabbix-agent-3.2.3-1.el7.x86_64.rpm is not installed (23/26): zabbix-agent-3.2.3-1.el7.x86_64.rpm | 338 kB 00:00:30 (24/26): zabbix-server-mysql-3.2.3-1.el7.x86_64.rpm | 1.8 MB 00:01:59 (25/26): zabbix-web-mysql-3.2.3-1.el7.noarch.rpm | 5.3 kB 00:00:00 (26/26): zabbix-web-3.2.3-1.el7.noarch.rpm | 3.6 MB 00:02:03 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 99 kB/s | 16 MB 00:02:41 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Importing GPG key 0xF4A80EB5: Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) " Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5 Package : centos-release-7-1.1503.el7.centos.2.8.x86_64 (@anaconda) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Is this ok [y/N]: y Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 Importing GPG key 0x352C64E5: Userid : "Fedora EPEL (7) " Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5 Package : epel-release-7-9.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 Is this ok [y/N]: y Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 Importing GPG key 0xA14FE591: Userid : "Zabbix LLC " Fingerprint: a184 8f53 52d0 22b9 471d 83d0 082a b56b a14f e591 Package : zabbix-release-3.2-1.el7.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 Is this ok [y/N]: y Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : apr-1.4.8-3.el7.x86_64 1/26 Installing : apr-util-1.5.2-6.el7.x86_64 2/26 Installing : httpd-tools-2.4.6-45.el7.centos.x86_64 3/26 Installing : iksemel-1.4-6.el7.x86_64 4/26 Installing : OpenIPMI-modalias-2.0.19-15.el7.x86_64 5/26 Installing : OpenIPMI-libs-2.0.19-15.el7.x86_64 6/26 Installing : libzip-0.10.1-8.el7.x86_64 7/26 Installing : php-common-5.4.16-42.el7.x86_64 8/26 Installing : php-cli-5.4.16-42.el7.x86_64 9/26 Installing : php-mbstring-5.4.16-42.el7.x86_64 10/26 Installing : php-ldap-5.4.16-42.el7.x86_64 11/26 Installing : php-xml-5.4.16-42.el7.x86_64 12/26 Installing : php-bcmath-5.4.16-42.el7.x86_64 13/26 Installing : php-pdo-5.4.16-42.el7.x86_64 14/26 Installing : php-mysql-5.4.16-42.el7.x86_64 15/26 Installing : unixODBC-2.3.1-11.el7.x86_64 16/26 Installing : t1lib-5.1.2-14.el7.x86_64 17/26 Installing : php-gd-5.4.16-42.el7.x86_64 18/26 Installing : fping-3.10-4.el7.x86_64 19/26 Installing : mailcap-2.1.41-2.el7.noarch 20/26 Installing : httpd-2.4.6-45.el7.centos.x86_64 21/26 Installing : php-5.4.16-42.el7.x86_64 22/26 Installing : zabbix-web-mysql-3.2.3-1.el7.noarch 23/26 Installing : zabbix-web-3.2.3-1.el7.noarch 24/26 Installing : zabbix-server-mysql-3.2.3-1.el7.x86_64 25/26 Installing : zabbix-agent-3.2.3-1.el7.x86_64 26/26 Verifying : php-cli-5.4.16-42.el7.x86_64 1/26 Verifying : php-mysql-5.4.16-42.el7.x86_64 2/26 Verifying : mailcap-2.1.41-2.el7.noarch 3/26 Verifying : OpenIPMI-libs-2.0.19-15.el7.x86_64 4/26 Verifying : php-mbstring-5.4.16-42.el7.x86_64 5/26 Verifying : fping-3.10-4.el7.x86_64 6/26 Verifying : php-common-5.4.16-42.el7.x86_64 7/26 Verifying : zabbix-web-mysql-3.2.3-1.el7.noarch 8/26 Verifying : php-ldap-5.4.16-42.el7.x86_64 9/26 Verifying : apr-1.4.8-3.el7.x86_64 10/26 Verifying : php-gd-5.4.16-42.el7.x86_64 11/26 Verifying : zabbix-server-mysql-3.2.3-1.el7.x86_64 12/26 Verifying : zabbix-agent-3.2.3-1.el7.x86_64 13/26 Verifying : httpd-tools-2.4.6-45.el7.centos.x86_64 14/26 Verifying : zabbix-web-3.2.3-1.el7.noarch 15/26 Verifying : php-xml-5.4.16-42.el7.x86_64 16/26 Verifying : t1lib-5.1.2-14.el7.x86_64 17/26 Verifying : php-bcmath-5.4.16-42.el7.x86_64 18/26 Verifying : unixODBC-2.3.1-11.el7.x86_64 19/26 Verifying : apr-util-1.5.2-6.el7.x86_64 20/26 Verifying : php-pdo-5.4.16-42.el7.x86_64 21/26 Verifying : httpd-2.4.6-45.el7.centos.x86_64 22/26 Verifying : php-5.4.16-42.el7.x86_64 23/26 Verifying : libzip-0.10.1-8.el7.x86_64 24/26 Verifying : OpenIPMI-modalias-2.0.19-15.el7.x86_64 25/26 Verifying : iksemel-1.4-6.el7.x86_64 26/26 Installed: zabbix-agent.x86_64 0:3.2.3-1.el7 zabbix-server-mysql.x86_64 0:3.2.3-1.el7 zabbix-web.noarch 0:3.2.3-1.el7 zabbix-web-mysql.noarch 0:3.2.3-1.el7 Dependency Installed: OpenIPMI-libs.x86_64 0:2.0.19-15.el7 OpenIPMI-modalias.x86_64 0:2.0.19-15.el7 apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7 fping.x86_64 0:3.10-4.el7 httpd.x86_64 0:2.4.6-45.el7.centos httpd-tools.x86_64 0:2.4.6-45.el7.centos iksemel.x86_64 0:1.4-6.el7 libzip.x86_64 0:0.10.1-8.el7 mailcap.noarch 0:2.1.41-2.el7 php.x86_64 0:5.4.16-42.el7 php-bcmath.x86_64 0:5.4.16-42.el7 php-cli.x86_64 0:5.4.16-42.el7 php-common.x86_64 0:5.4.16-42.el7 php-gd.x86_64 0:5.4.16-42.el7 php-ldap.x86_64 0:5.4.16-42.el7 php-mbstring.x86_64 0:5.4.16-42.el7 php-mysql.x86_64 0:5.4.16-42.el7 php-pdo.x86_64 0:5.4.16-42.el7 php-xml.x86_64 0:5.4.16-42.el7 t1lib.x86_64 0:5.1.2-14.el7 unixODBC.x86_64 0:2.3.1-11.el7 Complete! [root@zabbix-me software]#
五、Percona MySQL:安装并配置
安装过程,不在重复,本站就有很多文章在说这件事。
配置:
文件:/etc/percona-server.conf.d/mysqld.cnf
[root@zabbix-me ~]# cat /etc/percona-server.conf.d/mysqld.cnf # Percona Server template configuration [mysqld] # # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M #datadir=/var/lib/mysql #socket=/var/lib/mysql/mysql.sock #log-bin=percona-bin-log datadir=/data/database/percona_data/db_data socket=/data/database/percona_data/mysql.sock log-bin=/data/database/percona_data/binlog_data/percona-binlog server-id=1 bind-address = 127.0.0.1 local-infile = 0 # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 log-error=/var/log/mysqld-error.log pid-file=/var/run/mysqld/mysqld.pid [client] socket=/data/database/percona_data/mysql.sock [root@zabbix-me ~]#
创建目录:
mkdir -p /data/database/percona_data/{binlog_data,db_data}
启动服务:
[root@zabbix-me db_data]# service mysql restart Redirecting to /bin/systemctl restart mysql.service [root@zabbix-me db_data]#
修改初始口令:
[root@zabbix-me ~]# cat /var/log/mysqld-error.log | grep --color "A temporary password" 2017-02-24T09:51:44.938737Z 1 [Note] A temporary password is generated for root@localhost: w4htls/2odtC [root@zabbix-me ~]# [root@zabbix-me ~]# mysql -u root -p'w4htls/2odtC' mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.17-11-log Copyright (c) 2009-2016 Percona LLC and/or its affiliates Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> set password = password('Abcd1@34'); Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> exit Bye [root@zabbix-me ~]#
创建ZABBIX底层库:
mysql> show master status; +-----------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +-----------------------+----------+--------------+------------------+-------------------+ | percona-binlog.000003 | 398 | | | | +-----------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec) mysql> mysql> mysql> create database zabbix character set utf8 collate utf8_bin; Query OK, 1 row affected (0.03 sec) mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'Abcd1@34'; Query OK, 0 rows affected, 1 warning (0.05 sec) mysql> select user,host from mysql.user; +-----------+-----------+ | user | host | +-----------+-----------+ | mysql.sys | localhost | | root | localhost | | zabbix | localhost | +-----------+-----------+ 3 rows in set (0.00 sec) mysql>
初始化:
[root@zabbix-me zabbix-server-mysql-3.2.3]# zcat create.sql.gz | mysql -u root -p'Abcd1@34' zabbix mysql: [Warning] Using a password on the command line interface can be insecure. [root@zabbix-me zabbix-server-mysql-3.2.3]# [root@zabbix-me zabbix-server-mysql-3.2.3]# mysql -u root -p'Abcd1@34' mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.7.17-11-log Percona Server (GPL), Release 11, Revision f60191c Copyright (c) 2009-2016 Percona LLC and/or its affiliates Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use zabbix; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +----------------------------+ | Tables_in_zabbix | +----------------------------+ | acknowledges | | actions | | alerts | | application_discovery | | application_prototype | | application_template | | applications | | auditlog | | auditlog_details | | autoreg_host | | conditions | | config | | corr_condition | | corr_condition_group | | corr_condition_tag | | corr_condition_tagpair | | corr_condition_tagvalue | | corr_operation | | correlation | | dbversion | | dchecks | | dhosts | | drules | | dservices | | escalations | | event_recovery | | event_tag | | events | | expressions | | functions | | globalmacro | | globalvars | | graph_discovery | | graph_theme | | graphs | | graphs_items | | group_discovery | | group_prototype | | groups | | history | | history_log | | history_str | | history_text | | history_uint | | host_discovery | | host_inventory | | hostmacro | | hosts | | hosts_groups | | hosts_templates | | housekeeper | | httpstep | | httpstepitem | | httptest | | httptestitem | | icon_map | | icon_mapping | | ids | | images | | interface | | interface_discovery | | item_application_prototype | | item_condition | | item_discovery | | items | | items_applications | | maintenances | | maintenances_groups | | maintenances_hosts | | maintenances_windows | | mappings | | media | | media_type | | opcommand | | opcommand_grp | | opcommand_hst | | opconditions | | operations | | opgroup | | opinventory | | opmessage | | opmessage_grp | | opmessage_usr | | optemplate | | problem | | problem_tag | | profiles | | proxy_autoreg_host | | proxy_dhistory | | proxy_history | | regexps | | rights | | screen_user | | screen_usrgrp | | screens | | screens_items | | scripts | | service_alarms | | services | | services_links | | services_times | | sessions | | slides | | slideshow_user | | slideshow_usrgrp | | slideshows | | sysmap_element_url | | sysmap_url | | sysmap_user | | sysmap_usrgrp | | sysmaps | | sysmaps_elements | | sysmaps_link_triggers | | sysmaps_links | | task | | task_close_problem | | timeperiods | | trends | | trends_uint | | trigger_depends | | trigger_discovery | | trigger_tag | | triggers | | users | | users_groups | | usrgrp | | valuemaps | +----------------------------+ 127 rows in set (0.00 sec) mysql> exit Bye [root@zabbix-me zabbix-server-mysql-3.2.3]#
六、ZABBIX:配置
配置文件:/etc/zabbix/zabbix_server.conf
[root@zabbix-me zabbix-server-mysql-3.2.3]# cat /etc/zabbix/zabbix_server.conf LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_server.pid DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=Abcd1@34 SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 AlertScriptsPath=/usr/lib/zabbix/alertscripts ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000 [root@zabbix-me zabbix-server-mysql-3.2.3]#
升级:trousers
[root@zabbix-me zabbix-server-mysql-3.2.3]# rpm -qa | grep trousers trousers-0.3.11.2-3.el7.x86_64 [root@zabbix-me zabbix-server-mysql-3.2.3]# [root@zabbix-me zabbix-server-mysql-3.2.3]# yum list | grep --color trousers trousers.x86_64 0.3.11.2-3.el7 @anaconda trousers.i686 0.3.13-1.el7 base trousers.x86_64 0.3.13-1.el7 base trousers-devel.i686 0.3.13-1.el7 base trousers-devel.x86_64 0.3.13-1.el7 base trousers-static.i686 0.3.13-1.el7 base trousers-static.x86_64 0.3.13-1.el7 base [root@zabbix-me zabbix-server-mysql-3.2.3]# [root@zabbix-me zabbix-server-mysql-3.2.3]# yum update trousers Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.cn99.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.cn99.com * updates: mirrors.cn99.com Resolving Dependencies --> Running transaction check ---> Package trousers.x86_64 0:0.3.11.2-3.el7 will be updated ---> Package trousers.x86_64 0:0.3.13-1.el7 will be an update --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================================================================ Updating: trousers x86_64 0.3.13-1.el7 base 289 k Transaction Summary ================================================================================================================================================================================ Upgrade 1 Package Total size: 289 k Is this ok [y/d/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : trousers-0.3.13-1.el7.x86_64 1/2 Cleanup : trousers-0.3.11.2-3.el7.x86_64 2/2 Verifying : trousers-0.3.13-1.el7.x86_64 1/2 Verifying : trousers-0.3.11.2-3.el7.x86_64 2/2 Updated: trousers.x86_64 0:0.3.13-1.el7 Complete! [root@zabbix-me zabbix-server-mysql-3.2.3]# [root@zabbix-me zabbix-server-mysql-3.2.3]# rpm -qa | grep trousers trousers-0.3.13-1.el7.x86_64 [root@zabbix-me zabbix-server-mysql-3.2.3]#
七、ZABBIX:启动服务
具体如下:
[root@zabbix-me zabbix]# systemctl start zabbix-server [root@zabbix-me zabbix]# [root@zabbix-me zabbix]# systemctl status zabbix-server zabbix-server.service - Zabbix Server Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled) Active: active (running) since Fri 2017-02-24 18:13:23 CST; 30s ago Process: 21801 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS) Process: 21812 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS) Main PID: 21814 (zabbix_server) CGroup: /system.slice/zabbix-server.service └─21814 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf Feb 24 18:13:23 zabbix-me systemd[1]: Starting Zabbix Server... Feb 24 18:13:23 zabbix-me systemd[1]: PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start. Feb 24 18:13:23 zabbix-me systemd[1]: Started Zabbix Server. [root@zabbix-me zabbix]# [root@zabbix-me zabbix]# chkconfig zabbix-server on Note: Forwarding request to 'systemctl enable zabbix-server.service'. ln -s '/usr/lib/systemd/system/zabbix-server.service' '/etc/systemd/system/multi-user.target.wants/zabbix-server.service' [root@zabbix-me zabbix]#
配置HTTPD的虚拟主机:
[root@zabbix-me zabbix]# cat /etc/httpd/conf.d/zabbix.conf # # Zabbix monitoring system php web frontend # Alias /zabbix /usr/share/zabbix Options FollowSymLinks AllowOverride None Require all granted php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 # php_value date.timezone Europe/Riga php_value date.timezone Asia/Shanghai Require all denied Require all denied Require all denied Require all denied [root@zabbix-me zabbix]#
启动HTTPD服务:
[root@zabbix-me zabbix]# systemctl start httpd [root@zabbix-me zabbix]# systemctl status httpd httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled) Active: active (running) since Fri 2017-02-24 18:17:35 CST; 6s ago Docs: man:httpd(8) man:apachectl(8) Main PID: 21920 (httpd) Status: "Processing requests..." CGroup: /system.slice/httpd.service ├─21920 /usr/sbin/httpd -DFOREGROUND ├─21921 /usr/sbin/httpd -DFOREGROUND ├─21922 /usr/sbin/httpd -DFOREGROUND ├─21923 /usr/sbin/httpd -DFOREGROUND ├─21924 /usr/sbin/httpd -DFOREGROUND └─21925 /usr/sbin/httpd -DFOREGROUND Feb 24 18:17:35 zabbix-me httpd[21920]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.158.1.129. Set the 'Server...his message Feb 24 18:17:35 zabbix-me systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full. [root@zabbix-me zabbix]# [root@zabbix-me zabbix]# chkconfig httpd on Note: Forwarding request to 'systemctl enable httpd.service'. ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service' [root@zabbix-me zabbix]#
然后,就可以访问WEB了:
URL:http://10.158.1.129/zabbix/setup.php
——————————————————————————
Done。