zabbix--监控web服务(1)web端口

1,关闭防火墙和selinux,安装httpd并启动

[root@localhost ~] systemctl stop firewalld
[root@localhost ~] setenforce 0

[root@localhost ~] yum -y install httpd
[root@localhost ~] systemctl enable httpd #添加开机自启
[root@localhost ~] systemctl start httpd

2,安装zabbix-agent

#上传阿里云yum源至/etc/yum.repos.d/
[root@localhost ~] cat /etc/yum.repos.d/zabbix_Aliyun.repo 
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=0
 
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
#安装agent
[root@localhost ~] yum -y install zabbix-agent

3,修改配置文件并启动

[root@localhost ~] vim /etc/zabbix/zabbix_agentd.conf
[root@localhost ~] cat /etc/zabbix/zabbix_agentd.conf |egrep "Server|Hostname"|sed '/^#/d'
Server=192.168.59.110 #为server端ip
ServerActive=192.168.59.110 #为server端ip

[root@localhost ~] systemctl enable zabbix-agent #添加开机自启
[root@localhost ~] systemctl start zabbix-agent

4,在客户端添加监控项目和触发器
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
5,可以在客户端宕掉httpd服务,就可以报警了
在这里插入图片描述

发布了56 篇原创文章 · 获赞 65 · 访问量 1993

猜你喜欢

转载自blog.csdn.net/xiaohuai0444167/article/details/105393346