一、搭建基础环境 lamp
#yum -y install wget net-snmp-devel OpenIPMI-devel httpd openssl-devel java lrzsz fping-devel libcurl-devel perl-DBI pcre-devel libxml2 libxml2-devel mysql-devel gcc php php-bcmath php-gd php-xml php-mbstring php-ldap php-mysql.x86_64 php-pear php-xmlrpc net-tools wget vim-enhanced #首先安装依赖包
#systemctl stop firewalld.service #关闭防火墙
#wget -P /etc/yum.repos.d http://mirrors.aliyun.com/repo/Centos-7.repo #下载YUM源
# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm #安装zabbix的YUM源
# yum install zabbix-agent
二、安装mysql
rpm -ivh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm #安装mysql centos 7的yum源
yum -y install mysql-server #安装mysql
qxit #退出后
cd /usr/share/doc/zabbix-server-mysql-3.0.0 #进入安装的zabbix-server 目录
zcat create.sql.gz | mysql -uzabbix -pzabbix zabbix #同步数据,这里输入后会出现Warning: Using a password on the command line interface can be insecure. #提示这里输入数据库密码不安全
四、修改配置文件
vim /etc/zabbix/zabbix_server.conf
#修改zabbix配置文件
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
systemctl start zabbix-server
#开启zabbix-serversystemctl enable zabbix-server #设置开机自启动
vim /etc/httpd/conf.d/zabbix.conf #
修改httpd中zabbix文件,设置时区
php_value
date
.timezone Asia
/Shanghai
#####systemctl restart httpd.service
systemctl enable httpd # 设置开机自启动
如果开启zabbix-server时出现Job for zabbix-server.service failed. See 'systemctl status zabbix-server.service' and 'journalctl -xn' for details
#解决方法 yum update trousers
客户端安装
1、首先关闭防火墙
systemctl stop firewalld.service
setenforce 0
2、下载zabbix yum源
# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm #安装zabbix的YUM源
3、安装zabbix客户端
yum-y install zabbix-agent
4、修改配置文件
vim /etc/zabbix/zabbix_agentd.conf
修改内容如下
Server=192.168.80.10 #服务端地址
ServerActive=192.168.80.10 #服务端地址
Hostname=zabbix2 #可自定义
5、开启zabbix-agent服务
systemctl start zabbix-agent
systemclt enable zabbix-agent
如果出现Job for zabbix-server.service failed. See 'systemctl status zabbix-server.service' and 'journalctl -xn' for details
yum update trousers
yum -y install gnutls
完成