简介
Zabbix是一个基于Web界面的提供分布式系统监控以及网络监控功能的企业级的开源解决方案,它可以监控各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题,本文将详细介绍如何部署Zabbix监控服务器。
环境准备
1、硬件需求:至少2台服务器,推荐4台以上,每台服务器至少需要2GB内存,建议使用8GB或更高,硬盘空间需足够存储监控数据。
2、操作系统:推荐使用CentOS 7.x或Ubuntu 16.04 LTS。
3、Zabbix版本:推荐使用最新稳定版,当前为5.0。
安装Zabbix server
1、在一台或多台服务器上安装Zabbix server软件包,以CentOS 7.x为例,执行以下命令:
sudo yum install epel-release -y sudo yum install zabbix-server-mysql mysql-server -y
2、修改MySQL配置文件,允许远程访问:
sudo vi /etc/my.cnf
在[mysqld]
部分添加以下内容:
bind-address = 0.0.0.0
保存并退出,然后重启MySQL服务:
sudo systemctl restart mysqld
3、创建Zabbix数据库和用户:
CREATE DATABASE zabbix character set utf8 collate utf8_bin; CREATE USER 'zabbix'@'%' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'%'; FLUSH PRIVILEGES;
4、导入Zabbix官方模板:
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pyour_password zabbix
安装Zabbix web界面和代理软件包(可选)
1、在另一台或多台服务器上安装Nginx和PHP,以CentOS 7.x为例,执行以下命令:
sudo yum install epel-release -y sudo yum install httpd php php-mysql php-gd php-ldap php-xml php-bcmath php-snmp php-soap curl curl-devel pcre pcre-devel zlib zlib-devel mpm_prefork mpm_event mpm_worker mpm_common mpm_linux_module openssl-devel ca-certificates --enablerepo=epel --disablerepo=mysql --skip-broken enablerepo=remi --enablerepo=rhel-7-server-extras --skip-broken enablerepo=rhel-php72 --enablerepo=rhel-7-server-rhscl-7-rpms enablerepo=rhel-7-server-tools --enablerepo=rhel-7-server-rhscl-7-rpms enablerepo=rhel-fasttrack-7-server-optional --enablerepo=rhel-fasttrack-7-server-optional enablerepo=rhel-7-server-openvz --enablerepo=rhel-7-server-openvz enablerepo=rhel-7-server-rhscl --enablerepo=rhel-7-server-rhscl enablerepo=rhel-server-rhscl-7-rpms enablerepo:ibm:ibmpowerkvm --skip-broken enablerepo:ibm:ibmpowerkvm --skip{ibm}powerkvm enablerepo:ibm:ibmpowerkvm --skip{ibm}powerkvm enablerepo:redhatenterpriselinux75 --skip{redhat}enterpriselinux75 --skip{oraclelinux}enterpriselinux75 --skip{centosplus}enterpriselinux75 --skip{scientific}enterpriselinux75 --skip{suse}enterpriselinux75 --skip{sles}enterpriselinux75 --skip{ubuntu}trusty --enablerepo=remi --enablerepo=rhel --enablerepo=rhel-server rhel-server-rhscl-7-rpms rhel-fasttrack-7-server rhel-fasttrack-7-server optional rhel-server-rhscl rhel-server rhel7 openvz powerkvm redhatenterpriselinux75 oraclelinux enterpriselinux75 centosplus scientific suse sles trusty centos centosplus oracle oraclecentos fedora fedoradefaults fedoraupdates updates remi rhel remi7 remi8 base devel epel extras ibm powerkvm ibmpowerkvm redhatenterprise linux oraclelinux enterprise linux centos centosplus scientific suse opensuse suSE openSUSE Tumbleweed SUSE Leap SUSEFactoryware SUSEBase devel epel extras ibm powerkvm ibmpowerkvm redhatenterprise linux oraclelinux enterprise linux centos centosplus scientific suse opensuse suSE openSUSE Tumbleweed SUSE Leap SUSEFactoryware SUSEBase devel epel extras ibm powerkvm ibmpowerkvm redhatenterprise linux oraclelinux enterprise linux centos centosplus scientific suse opensuse suSE openSUSE Tumbleweed SUSE Leap SUSEFactoryware SUSEBase devel epel extras ibm powerkvm ibmpowerkvm redhatenterprise linux oraclelinux enterprise linux centos centosplus scientific suse opensuse suSE openSUSE Tumbleweed SUSE Leap SUSEFactoryware SUSEBase devel epel extras ibm powerkvm ibmpowerkvm redhatenterprise linux oraclelinux enterprise linux centos centosplus scientific suse opensuse suSE openSUSE Tumbleweed SUSE Leap SUSEFactoryware SUSEBase devel epel extras ibm powerkvm ibmpowerkvm redhatenterprise linux oraclelinux enterprise linux centos centosplus scientific suse opensuse suSE openSUSE Tumbleweed SUSE Leap SUSEFactoryware SUSEBase devel epel extras ibm powerkvm ibmpowerkvm redhatenterprise linux oraclelinux enterprise linux centos centosplus scientific zabbix web界面代理软件包下载地址:https://www.zabbix.com/downloadwebinterface&type=agent&version=4.0&platform=rhel&release=x86_64&license=apache2
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/196745.html