(一)Centos7安装zabbix3.4安装部署(server端、agent端)

(一)Centos7安装zabbix3.4 server端

(1)环境准备

  • 关闭firewalld和selinux
systemctl stop firewalld
systemctl  disable firewalld
#sed -ri '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
#setenforce 0
  • centos版本
cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
  • 安装mariadb
yum -y install mariadb-server mariadb 
systemctl start mariadb
systemctl enable mariadb
  • 安装zabbix
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql
  • 创建数据库和用户名,授权,执行zabbix的sql脚本
#mysql
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;
zcat /usr/share/doc/zabbix-server-mysql-3.4.8/create.sql.gz | mysql -uzabbix -pzabbix zabbix

(2)配置zabbix

  • 修改数据库密码
cp /etc/zabbix/zabbix_server.conf{,.old} 
#vi /etc/zabbix/zabbix_server.conf
DBPassword=zabbix
  • 修改apache时区
# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
  • 启动相关服务
systemctl start zabbix-server.service 
systemctl enable zabbix-server.service 
systemctl start httpd
systemctl enable httpd
  • 验证
netstat -nltp|egrep "zabbix|httpd|mysql"
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      44914/zabbix_server 
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      44637/mysqld        
tcp6       0      0 :::80                   :::*                    LISTEN      45022/httpd         
tcp6       0      0 :::10051                :::*                    LISTEN      44914/zabbix_server 

(3)图形界面安装配置

http://ip:port/zabbix
http://192.168.92.129/zabbix/setup.php
登陆,缺省用户名Admin,密码zabbix 

  • 配置数据库连接
  • 完成安装

  • 进入zabbix,调整英文为中文
  • 设置前端有故障发送报警声音

 
  • 安装zabbix-agentd
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum install zabbix-agent -y
systemctl enable zabbix-agent.service
  • agent端配置
# vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.92.129        #zabbix server地址
ServerActive=192.168.92.129    #zabbix server地址
或
sed -ri '/^ServerActive=127.0.0.1/cServerActive=192.168.92.129' /etc/zabbix/zabbix_agentd.conf
sed -ri '/^Server=127.0.0.1/cServer=192.168.92.129' /etc/zabbix/zabbix_agentd.conf 
  • 重启agent服务
systemctl start zabbix-agent.service
 
posted @ 2019-12-23 17:43  Shaon  阅读(721)  评论(0编辑  收藏  举报