搭建zabbix监控服务器

1、关闭selinux和防火墙

     vim  /etc/selinux/config

     systemctl stop  firewalld.service

     systemctl mask  firewalld.service

2、下载并安装zabbix安装包(网页下载)

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

 rpm   -ivh    zabbix-release-4.0-1.el7.noarch.rpm

3、安装zabbix相关软件

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

4、安装数据库(mariadb)

yum -y install mariadb-server  mariadb

5、修改数据库配置文件避免出现乱码

vim  /etc/my.cnf

 

6、启动数据库

systemctl   start       mariadb.service

systemctl                enabled   mariadb.service

7、创建数据库

Mysql   

create database  zabbix ;

show  databases ;

8、设置用户权限(用户zabbix   密码zabbix)

grant  all privileges  on zabbix.* to zabbix@‘localhost’ identified by ‘zabbix’

9、测试 用用户zabbix登陆数据库

mysql  -uzabbix  -pzabbix

10、导入数据库

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix

 

11、验证是否导入成功

mysql  -uzabbix  -pzabbix

Use   zabbix ;

Show  tables ;

 

12、搜索查看配置文件 /etc/zabbix/zabbix_server.conf

13、修改配置文件 /etc/zabbix/zabbix_server.conf

Vim   /etc/zabbix/zabbix_server.conf

92设置范围: 这里设置的是“localhost”

101 :配置数据库名字

117:设置数据库用户

126:设置数据库密码

 

14、为Zabbix前端配置PHP

cd /etc/httpd/conf.d/   

vim  zabbix.conf

20   php_value date.timezone  Asia/Shanghai

----------------------时间范文:命令timedatectl:

    Local time: 五 2019-01-25 15:27:00 CST

  Universal time: 五 2019-01-25 07:27:00 UTC

        RTC time: 五 2019-01-25 07:27:00

       Time zone: Asia/Shanghai (CST, +0800)

       NTP enabled: yes

       NTP synchronized: yes

       RTC in local TZ: no

       DST active: n/a

15、启动Zabbix serveragent进程

systemctl  start   httpd.service

systemctl  is-active   httpd.service

systemctl  enable   httpd.service

 

systemctl  start  zabbix-server.service

systemctl  is-active   zabbix-server.service

systemctl enabled zabbix-server.service

16、网页访问zabbix

http://zabbix服务器的IP地址/zabbix/setup.php

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值