阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Zabbix 3.4.12服务器端安装配置

125次阅读
没有评论

共计 5900 个字符,预计需要花费 15 分钟才能阅读完成。

Zabbix 介绍:

Zabbix 是一个基于 web 界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。

Zabbix 能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位 / 解决存在的各种问题。

Zabbix 由 2 部分构成,Zabbix server 与可选组件 Zabbix agent。

Zabbix server 可以通过 SNMP,Zabbix agent,ping,端口监视等方法提供对远程服务器 / 网络状态的监视,数据收集功能,它可以运行在 Linux,Ubuntu,Solarls,HP-UX,AIX,Free BSD,Open BSD,OS X 等平台上。

Zabbix agent 需要安装在被监视的目标服务器上,它主要完成对硬件信息或与操作系统有关的内存,CPU 等信息的收集。

Zabbix server 可以单独监视远程服务器的服务状态;同时也可以与 Zabbix agent 配合,可以轮询 Zabbix agent 主动接收监视数据(agent 方式),同时还可被动接收 Zabbix agent 发送的数据(trapping 方式)。

另外 Zabbix server 还支持 SNMP(v1,v2), 可以与 SNMP 软件(例如:net-snmp)等配合使用。

部署 Zabbix

环境:
服务器:192.168.56.12
需安装的应用:lamp 架构,zabbix server,zabbix agent。
由于 zabbix 使用 php 语言开发的,所以必须先部署 lamp 架构,使其支持运行 php 网页

1.zabbix 服务端安装
// 安装依赖包
[root@linuxidc.cm ~]# yum -y install net-snmp-devel libevent-devel
// 下载 zabbix
[root@linuxidc.cm ~]# cd /usr/src/
[root@linuxidc.cm src]# wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.12/zabbix-3.4.12.tar.gz
// 解压 zabbix
[root@linuxidc.cm src]# tar xf zabbix-3.4.12.tar.gz
// 创建 zabbix 用户和组
[root@linuxidc.cm ~]# groupadd -r zabbix
[root@linuxidc.cm ~]# useradd -r -g zabbix -M -s /sbin/nologin zabbix

// 配置 zabbix 数据库
[root@linuxidc.cm ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, 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 character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix123’;
Query OK, 0 rows affected, 2 warnings (0.00 sec)

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

[root@linuxidc.cm ~]# cd /usr/src/zabbix-3.4.12/database/mysql/
[root@linuxidc.cm mysql]# ls
data.sql images.sql schema.sql
[root@linuxidc.cm mysql]# mysql -uzabbix -pzabbix123 zabbix < schema.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@linuxidc.cm mysql]# mysql -uzabbix -pzabbix123 zabbix < images.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@linuxidc.cm mysql]# mysql -uzabbix -pzabbix123 zabbix < data.sql
mysql: [Warning] Using a password on the command line interface can be insecure.

// 编译安装 zabbix
[root@linuxidc.cm ~]# cd /usr/src/zabbix-3.4.12
[root@linuxidc.cm zabbix-3.4.12]# ./configure –enable-server \

–enable-agent \
–with-mysql \
–with-net-snmp \
–with-libcurl \
–with-libxml2
[root@linuxidc.cm zabbix-3.4.12]# make install

2.zabbix 服务端配置
[root@linuxidc.cm ~]# ls /usr/local/etc/
zabbix_agentd.conf zabbix_server.conf
zabbix_agentd.conf.d zabbix_server.conf.d
// 修改服务端配置文件
// 设置数据库信息
[root@linuxidc.cm ~]# ls /usr/local/etc/
zabbix_agentd.conf zabbix_server.conf
zabbix_agentd.conf.d zabbix_server.conf.d
[root@linuxidc.cm ~]# vi /usr/local/etc/zabbix_server.conf


DBPassword=zabbix123 // 设置 zabbix 数据库连接密码

// 启动 zabbix_server 和 zabbix_agentd
[root@linuxidc.cm ~]# zabbix_server
[root@linuxidc.cm ~]# zabbix_agentd
[root@linuxidc.cm ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 :22 :
LISTEN 0 100 127.0.0.1:25
:
LISTEN 0 128
:10050 :
LISTEN 0 128 :10051 :
LISTEN 0 128 127.0.0.1:9000
:
LISTEN 0 128 :::80 :::

LISTEN 0 128 :::22 :::
LISTEN 0 100 ::1:25 :::

LISTEN 0 80 :::3306 :::*

3.zabbix 服务端 web 界面 an 装与配置
// 修改 /etc/php.ini 的配置并重启 php-fpm
[root@linuxidc.cm ~]# sed -ri ‘s/(post_max_size =)./\1 16M/g’ /etc/php.ini
[root@linuxidc.cm ~]# sed -ri ‘s/(max_execution_time =).
/\1 300/g’ /etc/php.ini
[root@linuxidc.cm ~]# sed -ri ‘s/(max_input_time =).*/\1 300/g’ /etc/php.ini[root@linuxidc.cm ~]# sed -i ‘/;date.timezone/a date.timezone = Asia/Shanghai’ /etc/php.ini
[root@linuxidc.cm ~]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm done

[root@linuxidc.cm ~]# cd /usr/src/zabbix-3.4.12
[root@linuxidc.cm zabbix-3.4.12]# ls
aclocal.m4 config.guess database Makefile README
AUTHORS config.log depcomp Makefile.am sass
bin config.status frontends Makefile.in src
build config.sub include man upgrades
ChangeLog configure INSTALL misc
compile configure.ac install-sh missing
conf COPYING m4 NEWS
[root@linuxidc.cm zabbix-3.4.12]# mkdir /usr/local/apache/htdocs/zabbix
[root@linuxidc.cm zabbix-3.4.12]# cp -a frontends/php/* /usr/local/apache/htdocs/zabbix/
[root@linuxidc.cm zabbix-3.4.12]# chown -R apache.apache /usr/local/apache/htdocs

// 配置 apache 虚拟主机
[root@linuxidc.cm ~]# vi /etc/httpd24/httpd.conf
</VirtualHost>

<VirtualHost :80>
DocumentRoot “/usr/local/apache/htdocs/zabbix”
ServerName zabbix.ranwoaini.com
ProxyRequests Off
ProxyPassMatch ^/(.
.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/zabbix/$1
<Directory “/usr/local/apache/htdocs/zabbix”>
Options none
AllowOverride none
Require all granted
</Directory>
</VirtualHost>

// 设置 zabbix/conf 目录的权限,让 zabbix 有权限生成配置文件 zabbix.conf.php
[root@linuxidc.cm ~]# chmod 777 /usr/local/apache/htdocs/zabbix/conf
[root@linuxidc.cm ~]# ll -d /usr/local/apache/htdocs/zabbix/conf
drwxrwxrwx. 2 apache apache 81 Jul 30 19:41 /usr/local/apache/htdocs/zabbix/conf
// 重启 apache
[root@linuxidc.cm ~]# apachectl stop
[root@linuxidc.cm ~]# apachectl start
// 添加域名映射
192.168.56.12 zabbix.ranwoaini.com

// 关闭防火墙,使用域名访问
[root@linuxidc.cm ~]# systemctl stop firewalld
[root@linuxidc.cm ~]# setenforce 0

Zabbix 3.4.12 服务器端安装配置Zabbix 3.4.12 服务器端安装配置
Zabbix 3.4.12 服务器端安装配置
Zabbix 3.4.12 服务器端安装配置Zabbix 3.4.12 服务器端安装配置
Zabbix 3.4.12 服务器端安装配置 默认登录用户 Admin,登录密码 zabbixZabbix 3.4.12 服务器端安装配置

更多 Zabbix 相关教程集合

在 Ubuntu 16.04 服务器上安装 Zabbix 3.2  https://www.linuxidc.com/Linux/2017-07/145519.htm
CentOS 7 LNMP 环境搭建 Zabbix3.0  https://www.linuxidc.com/Linux/2017-02/140134.htm
Ubuntu 16.04 安装部署监控系统 Zabbix2.4  https://www.linuxidc.com/Linux/2017-03/141436.htm
Zabbix 监控安装部署及警报配置  https://www.linuxidc.com/Linux/2017-03/141611.htm
Zabbix 触发器表达式详解 https://www.linuxidc.com/Linux/2017-03/141921.htm
Ubuntu 16.04 下安装部署 Zabbix3.0  https://www.linuxidc.com/Linux/2017-02/140395.htm
CentOS 7 下 Zabbix 3.0 安装详解 https://www.linuxidc.com/Linux/2017-03/141716.htm
Zabbix 3.2.6 通过 Orabbix 监控 Oracle 数据库  https://www.linuxidc.com/Linux/2017-10/147224.htm
Zabbix3.4 添加 Web 监测功能 https://www.linuxidc.com/Linux/2018-06/152769.htm
Zabbix 告警发送邮件时附带性能图 https://www.linuxidc.com/Linux/2018-05/152194.htm
Zabbix3.0 编译升级过程记录 https://www.linuxidc.com/Linux/2018-05/152193.htm
Debian 9.2 安装 Zabbix 3.4.2 https://www.linuxidc.com/Linux/2018-03/151338.htm

ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-21发表,共计5900字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中