1、安装mysql
yum install -y mariadb mariadb-server
systemctl start mariadb
2、安装apache
yum -y install httpd
systemctl start httpd.service
3、安装php
yum -y install php
yum -y install php-mysql
重启apache: systemctl restart httpd
4、安装zabbix
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql
5、初始化数据库
create database zabbix character set utf8 collate utf8_bin;
zcat create.sql.gz | mysql -u root -p zabbix
备注:需进入/usr/share/doc/zabbix-server-mysql-3.2.7
6、启动zabbix服务:
修改 /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=root
DBPassword=root
systemctl start zabbix-server
systemctl start httpd
进入:http://IP/zabbix/ 完成初始化,跳转至zabbix登陆界面,默认账户 Admin zabbix
7、安装代理
yum -y install zabbix-agent
修改etc/zabbix/zabbix_agentd.conf,修改参数如下:
Server:服务端IP地址
ServerActive:服务端IP地址
Hostname:本机IP地址
8、基本使用:
8.1 在Configuration -> Hosts中添加主机;
8.2 添加完成后在Monitoring下查看参数:
备注下例中添加主机时选择了linux os这个模板,理解模板里前置定义了监控项(item),监控异常后处理(trigger)、图标(graph)等