zabbix监控nginx
#nginx UserParameter=nginx_status.active,curl http://127.0.0.1/nginx_status 2>/dev/null |grep 'Active' |awk '{print $3}' UserParameter=nginx_status.reading,curl http://127.0.0.1/nginx_status 2>/dev/null |grep 'Reading' |awk '{print $2}' UserParameter=nginx_status.writing,curl http://127.0.0.1/nginx_status 2>/dev/null |grep 'Writing' |awk '{print $4}' UserParameter=nginx_status.waiting,curl http://127.0.0.1/nginx_status 2>/dev/null |grep 'Waiting' |awk '{print $6}' UserParameter=nginx_status.accepts,curl http://127.0.0.1/nginx_status 2>/dev/null |awk NR==3 |awk '{print $1}' UserParameter=nginx_status.handled,curl http://127.0.0.1/nginx_status 2>/dev/null |awk NR==3 |awk '{print $2}' UserParameter=nginx_status.requests,curl http://127.0.0.1/nginx_status 2>/dev/null |awk NR==3 |awk '{print $3}'
模板:
3.2 2017-03-28T10:13:15Z nginx nginx nginx nginx nginx 接受请求 0 0 nginx_status.accepts 30 90 365 0 3 0 0 0 0 1 0 0 0 nginx 活跃连接数 0 0 nginx_status.active 30 90 365 0 3 0 0 0 0 1 0 0 0 nginx 处理请求 0 0 nginx_status.handled 30 90 365 0 3 0 0 0 0 1 0 0 0 nginx 读进程 0 0 nginx_status.reading 30 90 365 0 3 0 0 0 0 1 0 0 0 nginx 请求总数 0 0 nginx_status.requests 30 90 365 0 3 0 0 0 0 1 0 0 0 nginx 等待进程 0 0 nginx_status.waiting 30 90 365 0 3 0 0 0 0 1 0 0 0 nginx 写进程 0 0 nginx_status.writing 30 90 365 0 3 0 0 0 0 1 0 0 0 nginx