简单使用zabbix监控nginx是否存活

1.在agent端修改主配置文件

vim /etc/zabbix/zabbix_agentd.conf
      ........
      ........
UserParameter=nginx.status[*],/shell/nginx_status.sh $1  #指定监控脚本的位置
UnsafeUserParameters=1

2.在/shell路径下,创建nginx_status.sh监控脚本

#!/bin/bash
function ping {
    /sbin/pidof nginx | wc -l
}
$1

3.重启agent服务

 

进入zabbix的web页面,设置相关监控项

设置Graphs

查看是否有数据

 

posted @ 2019-04-03 18:16  New_Journey  阅读(830)  评论(0编辑  收藏  举报