Zabbix简介
1、是开源的、跨平台的监控服务
2、支持多种获取数据的方式
a)SNMP协议:适用于监控网络设备
b) zabbix-agent:适用于主机/服务器
c) IPMI协议 :适用于获取硬件的物理信息、CPU的温度
d)JMX协议 :适用于java应用
3、多种报警方式
4、自动发现、自动注册功能
5、提供API接口
Zabbix5.0版本安装
1、关闭selinux、firewalld重启主机
1 vim /etc/selinux/config
2 setenforce 0
3 getenforce
4 systemctl stop firewalld.service
5 systemctl enable firewalld.service
6 systemctl disenable firewalld.service
7 systemctl disable firewalld.service
2、安装相关服务
# 安装zabbix 5.0 yum源
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# 清理yum缓存
yum clean all
#安装数据库
yum install mariadb-server.x86_64
systemctl start mariadb.service
systemctl enable mariadb.service
systemctl status mariadb.service
#在数据库中创建zabbix库,再创建一个存放zabbix初始数据
mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'redhat';
mysql> flush privileges;
mysql> exit;
#导入初始架构和数据
cd /usr/share/doc/zabbix-server-mysql-5.0.21/
zcat create.sql.gz | mysql -uroot zabbix
#安装httpd服务
yum install httpd-manual.noarch
systemctl start httpd
systemctl enable httpd
systemctl status httpd
# 安装zabbix server 和 agent
yum install zabbix-server-mysql zabbix-agent
# 安装红包软件集合包
yum install centos-release-scl
# 编辑配置文件
cd /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
# 安装zabbix前端软件包
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl
# 修改 zabbix_server.conf 配置文件
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbixuser
DBPassword=redhat
DBSocket=/var/lib/mysql/mysql.sock(套接字文件路径)
# 修改时区
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
#把zabbix-server加入开机启动项,重启rh-php72-php-fpm并加入开机启动项
systemctl start httpd
systemctl enable httpd
systemctl enable rh-php72-php-fpm.service
#查看zabbix服务信息
netstat -antp | grep zabbix
# 去浏览器登录zabbix-agent
# 初始用户密码
Admin
zabbix