一、工作要求及目的
要求ZABBIX实施监控httpd服务是否正常运行,并邮件告警
二、WEB配置步骤
1.进入监控主机列表
配置——主机
2.链接模板
3.查看自定义HTTP端口监控项
4.查看自定义的触发器
三、客户端测试http服务停止报警
1.停止服务
[root@node1 conf]# systemctl stop httpd.service
[root@node1 conf]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Fri 2021-06-04 16:21:58 CST; 5min ago
Docs: man:httpd.service(8)
Process: 9629 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
Process: 11134 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)
Main PID: 11134 (code=exited, status=0/SUCCESS)
Status: "Running, listening on: port 8081"
Jun 04 16:15:49 node1 systemd[1]: Starting The Apache HTTP Server...
Jun 04 16:15:49 node1 httpd[11134]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name>
Jun 04 16:15:49 node1 httpd[11134]: Server configured, listening on: port 8081
Jun 04 16:15:49 node1 systemd[1]: Started The Apache HTTP Server.
Jun 04 16:21:57 node1 systemd[1]: Stopping The Apache HTTP Server...
Jun 04 16:21:58 node1 systemd[1]: Stopped The Apache HTTP Server.
lines 1-15/15 (END)
2.查看web端报警
3.查看邮件报警
四、自定义模板及监控配置参考
自定义模板及监控配置参考本人之前写的博文Zabbix的模板管理与配置