zabbix

#yum install -y https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-server-mysql-3.0.0-1.el7.x86_64.rpm
yum install -y  https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-get-3.0.0-1.el7.x86_64.rpm

yum install -y https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-web-mysql-3.0.0-1.el7.noarch.rpm 
 
yum install -y https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-agent-3.0.0-1.el7.x86_64.rpm 
yum install -y https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-sender-3.0.0-1.el7.x86_64.rpm

zabbix 4    

rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

如果不能安装可以使用wget命令先下载RPM包在安装。
安装Zabbbix相关的MySQL组件,web组件和代理组件:

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

由于zabbix-server-mysql-3.0.0-1安装缺少依赖包的报错依赖
解决fping

yum -y install epel-release        仍然可以下载 3x

解决 libiksemel.so.3()(64bit)

yum -y install http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

创建zabbix用户 mysqkl
发生mysql1558错误_mysql删除用户错误ERROR 1558解决办法
ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 42. Created with MySQL 50560, now running 50645. Please use mysql_upgrade to fix this error.
意思是数据库以前做过升级但是数据库里的mysql库没有升级导致的权限混乱
升级数据库命令  mysql_upgrade -u root -p ‘密码’
然后进入到root
create database zabbix character set utf8 collate utf8_bin;        //建zabbix表
create user 'zabbix'@'localhost' identified by 'zabbix'
grant all on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';
vi /etc/zabbix/zabbix_server.conf
修改如下

 

注:此处创建分三种用户:
1.localhost:只可以本地登录,不可以远程登录
2.%:本地登录、远程登录都可以
3.ip地址:只可以限定的IP登录                                                                                                                                                                                                                                                       
导入数据库文件    
zcat /usr/share/doc/zabbix-server-mysql-3.0.0.0/create.sql.gz | mysql -u zabbix -p        //将create.sql 数据库文件导入到zabbix数据库
如果出现

 

 在第一行加上 use zabbix;

 

 mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-3.0.0.0/create.sql

 

 我看来网上很多教程
systemctl restart zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd        开机自启
后,浏览器输入http://服务器ip/zabbix/setup.php   就行了
他们都忘了说,web目录:/usr/share/zabbix
我查看了一下zabbix的配置文件: /etc/zabbix/zabbix_server.conf  /etc/zabbix/zabbix_agentd.conf
没有发现与/usr/share/zabbix目录有关的配置,所以/usr/share/zabbix 是独立的,可以移到/var/www/html
apache: cp -r /usr/share/zabbix  /var/www/html/
nginx: cp -r /usr/share/zabbix  /usr/local/nginx/html/

 

 

 发现有fail , 要修改一下php.ini 和配置一下时区
vi /etc/php.ini
修改为如下
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Shanghai

apache:     systemctl restart hpptd
nginx:    systemctl restart php-fpm
修改php.ini后,重启对应服务接口就好了

 

 

 

 

 

 

 

 

 出现这个问题,研究了好久,一晚上+一上午。。。
是selinux的问题,它要关掉
详情见:
https://www.cnblogs.com/CloudComputing-binbin/p/14618531.html

 

posted @ 2021-06-02 12:28  binbin_cloud  阅读(74)  评论(0编辑  收藏  举报