zabbix --原理
本身都是一对PHP 脚本,必须通过LAMP进行展示(zabbix-web接口)
监控端---zabbix-server---发送请求
被监控端----zabbix-agent SNMP(交换) JMX() IPMI(硬件:风扇)-----接收请求 收集数据返回数据
数据库--zabbix-database 存储数据
zabbix必用的组件:zabbix-server zabbix-agent zabbix-database zabbix-GUI(web)
可选组件: zabbix-java-gateway(JMX) zabbix-proxt(分布式)
使用端口:
10050 客户---端口
10051 服务---端口
zabbix 部署----yum安装
需要官方yum源、阿里云yum源(提供php-bcmath php-mbstring)
添加zabbix源
www.zabbix.com------download
rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
添加阿里云源
安装组件
[root@localhost yum.repos.d]# yum -y install httpd mariadb mariadb-server php php-mysql php-bcmath php-mbtring
Install Zabbix server, frontend, agent 安装服务端,WEB接口、客户端
启动mysql数据库
[root@localhost yum.repos.d]# systemctl start mariadb
[root@localhost yum.repos.d]# systemctl status mariadb
数据创建对应zabbix
Create initial database
mysql -u root
password
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
MariaDB [(none)]> flush privileges;刷新数据库
MariaDB [(none)]> quit;
安装zabbix
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
zabbix 模板数据库导到到mysql zabbix库中
[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql-4.0.3/create.sql.gz | mysql -uroot zabbix
[root@localhost zabbix]# vim /etc/zabbix/zabbix_server.conf
DBPassword=password 数据库设置的密码
修改PHP配置文件
[root@localhost zabbix]# vim /etc/php.ini
修改时区
date.timezone = Asia/Shanghai
启动服务
[root@localhost zabbix]# systemctl start httpd zabbix-server zabbix-agent
启动报错防火墙没有关
[root@localhost ~]# systemctl status zabbix-server.service -l
[root@localhost zabbix]# setenforce 0
[root@localhost zabbix]# systemctl start httpd zabbix-server zabbix-agent
查看启动服务端口
[root@localhost zabbix]# netstat -lnt
网页访问设置
http://192.168.0.231/zabbix