在LNMP基础上部署zabbix监控系统

本文详细介绍了如何在LNMP基础上部署zabbix监控系统,包括设置mysql、导入数据库、安装编译zabbix、配置服务端与客户端、解决字符集问题,以及配置监控远程主机等步骤。
摘要由CSDN通过智能技术生成

** zabbix部署**
软件包和环境介绍:

整个环境所需软件包:

php-7.1.2

libmcrypt-2.5.8

mysql-5.7.1

nginx-1.14

zabbix-4.4.1
zabbix的部署需要先部署LNMP环境,因为zabbix是通过php页面展示的。
[root@test-00 ~]# curl -I 10.0.0.100/index.php
HTTP/1.1 200 OK
Server: nginx/1.14.1
Date: Tue, 07 Jul 2020 11:29:35 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/7.1.24

#检查lnmp是否正常运行,本来mysql没有启动,现在启动mysql

[root@test-00 ~]# /etc/init.d/mysqld start
Starting MySQL SUCCESS!

设置mysl开机自启动

chkconfig mysqld on

导入zabbix数据库
新建zabbix数据库,zabbix用户,并授予all的权限

[root@test-00 ~]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.19 Source distribution

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database zabbix;
mysql> grant all on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye

导入zabbix源码包中自带的脚本

[root@test-00 src]# cd /usr/local/src/
[root@test-00 src]# tar xzvf zabbix-3.4.3.tar.gz
[root@test-00 src]# cd /usr/local/src/zabbix-3.4.3/database/mysql/

按顺序:schema.sql images.sql data.sql

[root@test-00 mysql]#  mysql -uzabbix -pzabbix zabbix < schema.sql
[root@test-00 mysql]# mysql -uzabbix -pzabbix zabbix < images.sql
[root@test-00 mysql]# mysql -uzabbix -pzabbix zabbix < data.sql

源码包安装zabbix
创建用户zabbix运行zabbix服务
[root@test-00 ~]# groupadd zabbix
[root@test-00 ~]# useradd -s /sbin/nologin -g zabbix zabbix
解决软件包依赖关系

[root@test-00 ~]# yum install -y net-snmp-devel libevent libevent-devel

编译

[root@test-00 ~]# cd /usr/local/src/zabbix-3.4.3
[root@test00 zabbix-3.4.3]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql=/var/lib/mysql/bin/mysql_config --with-net-snmp --with-libcurl

上面各参数详解
#–prefix= #指定路径
#–enable-server #Server 支持
#–enable-agent #支持Zabbix 客户端
#–with-mysql #指定MySql库可以选择自定路径mysql_config,mysql_config 是命令,用于编译 mysql 客户端程序
#–with-net-snmp #支持snmp协议,需要安装net-snmp-devel包
#–with-libcurl #支持CURL功能,libcurl主要功能就是用不同的协议连接不同的服务

#–libcurl #当前支持的协议有http、https、ftp、gopher、telent、dict、file和ldap 协议

#这里无需make
#编译安装

[root@test-00 zabbix-3.4.3]# make install

配置服务端zabbix_server
配置zabbix_server.conf文件
日志文件LogFile=/tmp/zabbix_server.log

[root@test-00 zabbix-3.4.3]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值