搭建zabbix监控服务

1,配置IP地址、主机名,关闭 kdump 与 SELinux
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
在这里插入图片描述

[root@localhost ~]# vim /etc/sysconfig/network
在这里插入图片描述

[root@localhost ~]# vim /etc/hosts
在这里插入图片描述

[root@localhost ~]# vim /etc/selinux/config
在这里插入图片描述

[root@localhost ~]# systemctl stop kdump
[root@localhost ~]# systemctl disable kdump
[root@localhost ~]# reboot

2,安装Apache 和 Mariadb
[root@zbx ~]# yum install httpd -y
在这里插入图片描述

[root@zbx ~]# yum install mariadb-server -y
在这里插入图片描述

[root@zbx ~]# systemctl start httpd.service
[root@zbx ~]# systemctl enable httpd.service
[root@zbx ~]# systemctl start mariadb.service
[root@zbx ~]# systemctl enable mariadb.service
3,安装PHP
[root@zbx ~]# yum -y install php
在这里插入图片描述





4,安装PHP组件,使PHP支持 MariaDB
[root@zbx ~]# yum -y install php-mysql php-gd libjpeg* php-ldap php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
在这里插入图片描述

5,重启MariaDB、 Apache
[root@zbx ~]# systemctl restart mariadb.service
[root@zbx ~]# systemctl restart httpd.service
6,安装“Zabbix安装包”资源存储库
[root@zbx ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
在这里插入图片描述




7,安装Zabbix
[root@zbx ~]# yum install centos-release-scl -y
在这里插入图片描述

8,对数据库进行初始化并创建Zabbix数据库
[root@zbx ~]# mysqladmin -u root password 9865321
[root@zbx ~]# mysql -uroot -p
在这里插入图片描述在这里插入图片描述


9,编辑Zabbix数据库配置文件并启动Zabbix服务
[root@zbx ~]# vim /etc/zabbix/zabbix_server.conf
在这里插入图片描述
在这里插入图片描述


[root@zbx ~]# systemctl start zabbix-server
[root@zbx ~]# systemctl enable zabbix-server

10,修改 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
[root@zbx ~]# vim /etc/httpd/conf.d/zabbix.conf
在这里插入图片描述

11,配置防火墙
[root@zbx ~]# systemctl stop firewalld.service

启动 Zabbix server and agent
[root@zbx ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@zbx ~]# systemctl enable zabbix-server zabbix-agent httpd
在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述


12,Linux Agent的安装与配置
[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
在这里插入图片描述

[root@localhost ~]# yum -y install zabbix-agent
在这里插入图片描述

[root@localhost ~]# vim /etc/zabbix/zabbix_agentd.conf
在这里插入图片描述
在这里插入图片描述

[root@localhost ~]# chkconfig zabbix-agent on
[root@localhost ~]# systemctl restart zabbix-agent.service
[root@localhost ~]# iptables -I INPUT -p tcp --dport 10050 -j ACCEPT
[root@localhost ~]# systemctl stop firewalld.service


13,在服务端添加主机

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

14,刷新一下
在这里插入图片描述

点击查看图形
在这里插入图片描述在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章