1,配置apache
ExtendedStatus On
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
2,添加监控脚步apache_status.sh
#!/bin/bash
if [[ "$1" = "Workers" ]]; then
wget --quiet -O - http://127.0.0.1/server_status?auto | grep Score | grep -o "\." | wc -l
else
wget --quiet -O - http://127.0.0.1/server_status?auto | head -n 9 | grep $1 | awk -F ":" '{print $2}'
fi
3,配置客户端zabbix_agentd.conf
UserParameter=apache[*],/usr/local/zabbix/etc/apache_status.sh $1
4,在服务端对应主机上添加模板