监控-----zabbix架构(server-client)部署

本文档详细介绍了如何部署Zabbix的server-client架构,包括在server端配置LAMP环境,安装zabbix server,设置web界面,在client端安装zabbix agentd,并最终在web界面监控client端。
摘要由CSDN通过智能技术生成

目录

一.环境介绍

二.实验具体操作

在server端部署LAMP架构

在server端部署zabbix server

在本机上安装zabbix的web界面

在client端部署zabbix agentd

在zabbix的web界面监控client端


一.环境介绍

角色 系统 安装内容
监控端server(192.168.43.101) CentOS7.4 LAMP架构、Zabbix-server
被监控端clinet(192.168.43.102) CentOS7.4 Zabbix-agentd
  • 本实验搭建zabbix最简单的server-client架构,采用zabbix源码编译方式安装,LAMP架构采用yum安装

二.实验具体操作

在server端部署LAMP架构

环境准备

#永久修改主机名
[root@localhost ~]# hostnamectl set-hostname server
[root@localhost ~]# su
#正则关闭selinux核心防护
[root@server ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@server ~]# setenforce 0
#查看是否设置成功
[root@server ~]# getenforce 0
Permissive
#关闭防火墙
[root@server ~]# systemctl stop firewalld.service 
[root@server ~]# systemctl disable firewalld.service 
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@server ~]# 

安装软件包

  • 安装apache
[root@server ~]# yum install -y httpd
  • 安装mariadb
[root@server ~]# yum install -y mariadb mariadb-server
  • 安装php以及扩展依赖包
[root@server ~]# yum install -y php php-bcmath php-mbstring \
> php-mysql php-gd php-ldap php-xml
  • 安装依赖库
[root@server ~]# yum install -y unixODBC-devel mysql-devel \
> net-snmp-devel libxml2-devel libcurl-devel libevent-devel gcc

修改apache与php的配置文件

#配置apache
[root@server ~]# vi /etc/httpd/conf/httpd.conf 

ServerName 127.0.0.1

DocumentRoot "/var/www/html/zabbix"

[root@server ~]# mkdir -p /var/www/html/zabbix
[root@server ~]# 


#配置php
vim /etc/php.ini
date.timezone = Asia/Shanghai        //设置时区
post_max_size = 32M                //设置上传文件大小
max_execution_time = 300
max_input_time = 300
always_populate_raw_post_data = -1

配置php界面

[root@server ~]# cat /var/www/html/zabbix/index.php
<?php
phpinfo();
?>
[root@server ~]# 

启动服务并且验证php界面

[root@server ~]# systemctl start httpd.service 
[root@server ~]# systemctl enable httpd.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@server ~]# systemctl start mariadb.service 
[root@server ~]# systemctl enable mariadb.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@server ~]# 

初始化mariadb并且设置zabbix数据库用户

  • 设置数据库
#设置安全导向
[root@server ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (en
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值