zabbix

1.下载zabbix

[root@xiaokeyan ~]# rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/
[root@xiaokeyan ~]# rpm -ql zabbix-release 
[root@xiaokeyan ~]# cat  /etc/yum.repos.d/zabbix.repo

2.用yum makecache 服务器的包信息下载到本地电脑缓存起来

[root@xiaokeyan ~]#  yum makecache 

3.安装zabbix 数据库,服务器端,agent端以及zabbix一些必要的组件,详细请参考官方的手册.

[root@xiaokeyan ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-serser zabbix-agent mariadb-server

4.启动数据库

[root@xiaokeyan ~]# systemctl start mariadb
[root@xiaokeyan ~]# mysql -uroot -p   #键入以下两条命令
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
MariaDB [(none)]> quit

5.再次登陆数据库查看

MariaDB [(none)]> show databases;
MariaDB [(none)]> quit

6.导入初始架构(Schema)和数据。

[root@xiaokeyan ~]#  cd  /usr/share/doc/zabbix-server-mysql-3.4.15/
[root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]# zcat create.sql.gz | mysql -uroot zabbix -p 

7 #以下命令查看导入的数据架构和数据表

[root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]# mysql -uroot -p
MariaDB [(none)]> show databases;
MariaDB [(none)]> use zabbix;
MariaDB [zabbix]> show tables;
MariaDB [zabbix]> quit

8.让数据库和zabbix Server端 和数据库建立连接

[root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]# vi /etc/zabbix/zabbix_server.conf    #取消以下几个注释
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

9.查看在之前在zabbix_server.config里更改的内容

[root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]# grep '^[a-Z]' /etc/zabbix/zabbix_server.conf 

10.启动并检查Zabbix Server进程

[root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]# systemctl start zabbix-server
[root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]#  systemctl status zabbix-server

zabbix错误日志

[root@xiaokeyan ~]# tail -f /var/log/zabbix/zabbix_server.log
报错1:cannot set resource limit: [13] permission denied
相关解决方案:关闭防火墙与selinux
具体操作:[root@xiaokeyan ~]# systemctl stop firewalld.service   
         [root@xiaokeyan ~]# systemctl disable firewalld.service 
        vi /etc/selinux/config   
       SELINUX=disabled    #selinux状态更改为disabled
       setenforce 0

11.更改配置文件(时区一行)

[root@xiaokeyan ~]# vim /etc/httpd/conf.d/zabbix.conf 
image.png

开启与检查是否开启httpd

 [root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]# systemctl start httpd
[root@xiaokeyan /usr/share/doc/zabbix-server-mysql-3.4.15]# systemctl status httpd

可能会出现的报错:

image.png

相关解决方案 vim /etc/httpd/conf.d/zabbix.conf追加以下:

 ServerName domain_name:80
 或者本地主机
 ServerName localhost:80
 systemctl stop httpd    #配置完成重启服务
 systemctl start httpd
 浏览器网址: [http://IP/zabbix]
 默认的用户名/密码为 Admin/zabbix。
 自己网址:[http://10.0.0.204/zabbix](http://10.0.0.204/zabbix)

#####不要忘记
image.png

image.png

你可能感兴趣的:(zabbix)