CentOS7安装zabbix3.2

来源:互联网 发布:软件测试绩效考核指标 编辑:程序博客网 时间:2024/06/05 16:01

1,卸载原有的Mysql

rpm -qa|grep -i mysqlrpm -e --nodeps 包名

2,repository安装

yum install -y epel-releaserpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIXrpm -Uv http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

3,yum install
server端

yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get

client端

yum install -y zabbix-agent zabbix-java-gateway

4,安装mysql5.7
4.1

wget http://repo.mysql.com/mysql57-community-release-el7-9.noarch.rpmsudo yum localinstall mysql57-community-release-el7-9.noarch.rpmyum install -y mysql-server mysql-devel gcc gcc-devel python-develsystemctl stop mysqld.service

4.2 改本地密码建立远程用户

vi /etc/my.cnf

在[mysqld] 小节下添加一行:skip-grant-tables=1

systemctl restart mysqld.servicegrep 'temporary password' /var/log/mysqld.logmysql -uroot -puse mysql;update user set authentication_string = password(''), password_expired = 'N', password_last_changed = now() where user = 'root';exit;chkconfig --level 2345 mysqld on

4.3 追加远程用户(若zabbix-server,mysqlb在一台服务器不用做此操作)

vi /etc/my.cnf

注释:skip-grant-tables=1

systemctl restart mysqld.servicemysqluse mysql;set global validate_password_policy=0;grant all privileges on *.* to zabbix @"%" identified by "zabbix123#";flush privileges;

建Zabbix用的库,名称:zabbix

create database zabbix character set utf8 collate utf8_bin;

4.4 导入数据启动zabbix

vi /etc/zabbix/zabbix_server.conf

修改DBHost,DBName,DBUser,DBPassword
dbhost=localhost
dbname=zabbix
dbuser=root
dbpassword=
远程登录如下操作:

zcat /usr/share/doc/zabbix-server-mysql-3.2.4/create.sql.gz | mysql -uzabbix -p zabbix

本地登录如下操作:

zcat /usr/share/doc/zabbix-server-mysql-3.2.4/create.sql.gz | mysql -uroot -p zabbix

启动:

systemctl start zabbix-serversystemctl enable zabbix-server

4.5 启动zabbix web
查看是否存在文件

ls /etc/httpd/conf.dls /usr/share/zabbixsystemctl start httpd.service

4.6 不能访问关防火墙

systemctl stop firewalld.servicesystemctl disable firewalld.service

4.7 检查端口

vi /etc/httpd/conf/httpd.conf

检查是否开启ServerName localhost:80

登录系统
http://XXX/zabbix
用户名:Admin 密码:zabbix

若进入系统后发现Zabbix Server 没启动
查看日志:
tail /var/log/zabbix/zabbix_server.log 解决问题

常见问题
29406:20170401:180125.778 using configuration file: /etc/zabbix/zabbix_server.conf 29406:20170401:180125.778 cannot set resource limit: [13] Permission denied
解决: setenforce 0
5 安装zabbix-agent

rpm -Uv http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpmyum install -y zabbix-agentsystemctl start zabbix-agent.service 修改主机IP Server字段vi /etc/zabbix/zabbix_agentd.conf

6 Zabbix-get测试客户端

 zabbix_get -s 192.168.0.25 -k system.uname
0 0
原创粉丝点击