zabbix监测apache

1、apache

一、首次为检测apache有没有正常运行写一个脚本vim

运行中输出1,没有运行输出0:bash

[root@server etc]# vim /usr/local/zabbix/etc/chk_httpd.sh
#!/bin/bash
netstat -lnpt | grep -q :80
if [ $? -eq 0 ]
then
echo "1"
else
echo "0"
fi3d

二、给脚本777的权限server

[root@server ~]# chmod 777 /usr/local/zabbix/etc/chk_httpd.sh          blog

三、修改配置文件:进程

 vim /usr/local/zabbix/etc/zabbix_agentd.confget

添加:UserParameter=httpd.ststus,/usr/local/zabbix/etc/chk_httpd.sh $1监控

四、杀死进程从新开启:配置

[root@server ~]# killall -9 zabbix_agentd
[root@server ~]# zabbix_agentd

[root@server ~]# zabbix_get -s 192.168.200.111 -k httpd.status

监控项:

 

触发器:

 

 

图形:

 

 

相关文章
相关标签/搜索