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
添加阿里云源
安装组件
[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
来源: http://www.bubuko.com/infodetail-2916067.html