监控服务Zabbix部署

12 篇文章 0 订阅

监控服务Zabbix部署

部署Zabbix之前需要部署好LAMP服务

Zabbix官网:www.zabbix.com


1. zabbix源代码包安装
# 下载zabbix并解压
[root@localhost ~]# wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.25.tar.gz
[root@localhost ~]# tar xf zabbix-5.0.25.tar.gz 

# 安装依赖包
[root@localhost ~]# yum -y install net-snmp-devel libevent-devel

# 创建用户,更改目录属主权限
[root@localhost ~]# useradd -r -M -s /sbin/nologin zabbix
[root@localhost ~]# mkdir -p /usr/lib/zabbix
[root@localhost ~]# chown -R zabbix.zabbix /usr/lib/zabbix/
[root@localhost ~]# chmod 770 /usr/lib/zabbix/

2. 创建 Zabbix 数据库
[root@localhost ~]# mysql -uroot -p123456;

mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> create user 'zabbix'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
[root@localhost ~]# cd zabbix-5.0.25/database/mysql/
[root@localhost mysql]# ls
data.sql  double.sql  images.sql  Makefile.am  Makefile.in  schema.sql
[root@localhost mysql]# mysql -uzabbix -p123456 zabbix < schema.sql 
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@localhost mysql]# 
[root@localhost mysql]# mysql -uzabbix -p123456 zabbix < images.sql 
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@localhost mysql]# 
[root@localhost mysql]# mysql -uzabbix -p123456 zabbix < data.sql 
mysql: [Warning] Using a password on the command line interface can be insecure.


3. 配置源代码并安装
[root@localhost mysql]# cd ../..
[root@localhost zabbix-5.0.25]# ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
[root@localhost zabbix-5.0.25]# make install

4. 编辑配置文件和启动服务
[root@localhost zabbix-5.0.25]# cd /usr/local/etc/
[root@localhost etc]# ls
zabbix_agentd.conf  zabbix_agentd.conf.d  zabbix_server.conf  zabbix_server.conf.d
[root@localhost etc]# vim zabbix_server.conf
DBPassword=123456
[root@localhost etc]# zabbix_server 
[root@localhost etc]# ss -antl
State       Recv-Q      Send-Q            Local Address:Port              Peer Address:Port      Process      
LISTEN      0           128                     0.0.0.0:10051                  0.0.0.0:*                      
LISTEN      0           128                   127.0.0.1:9000                   0.0.0.0:*                      
LISTEN      0           128                     0.0.0.0:22                     0.0.0.0:*                      
LISTEN      0           128                        [::]:10051                     [::]:*                      
LISTEN      0           80                            *:3306                         *:*                      
LISTEN      0           128                           *:80                           *:*                      
LISTEN      0           128                        [::]:22                        [::]:*   

[root@localhost etc]# zabbix_agentd 
[root@localhost etc]# 
[root@localhost etc]# ss -antl
State       Recv-Q      Send-Q            Local Address:Port              Peer Address:Port      Process      
LISTEN      0           128                     0.0.0.0:10050                  0.0.0.0:*                      
LISTEN      0           128                     0.0.0.0:10051                  0.0.0.0:*                      
LISTEN      0           128                   127.0.0.1:9000                   0.0.0.0:*                      
LISTEN      0           128                     0.0.0.0:22                     0.0.0.0:*                      
LISTEN      0           128                        [::]:10050                     [::]:*                      
LISTEN      0           128                        [::]:10051                     [::]:*                      
LISTEN      0           80                            *:3306                         *:*                      
LISTEN      0           128                           *:80                           *:*                      
LISTEN      0           128                        [::]:22                        [::]:* 

5. 安装web界面和更改权限
[root@localhost ~]# rm -f /usr/local/apache/htdocs/test.com/*
[root@localhost ~]# cp -a zabbix-5.0.25/ui/* /usr/local/apache/htdocs/test.com
[root@localhost ~]# chmod 777 /usr/local/apache/htdocs/test.com/conf

6. 登录Zabbix web界面

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值