注:因显示问题下面【 为< 】为>
vim /etc/httpd/conf/httpd.conf #apache配置配置文件尾部添加如下 ExtendedStatus On 【location /server-status】 SetHandler server-status#注意修改符号 【】
Order Allow,Deny Allow from all 【/location】注:开启apache的server-status
/etc/init.d/httpd restart #重启
浏览器测试:http://localhost/server-status 是否开启server-status 如没有此模块重新编译
wget https://github.com/lorf/zapache/archive/master.zip #下载模版脚本 unizp master.zip #解压 cd zapache-master/ #进入解压目录 cp userparameter_zapache.conf.sample cd /usr/local/etc/zabbix_agentd.conf.d/ #拷贝 mv cp userparameter_zapache.conf.sample cp userparameter_zapache.conf #改名 cat userparameter_zapache.conf #查看内容 # # This is a sample zabbix_agentd config file. # Put it to /etc/zabbix_agentd.conf.d or otherwise integrate into agent config. # Edit to your needs. # UserParameter=zapache[*],/var/lib/zabbixsrv/externalscripts/zapache \$1 修改路径为 UserParameter=zapache[*],/usr/local/bin/zapache \$1 cd /zapache-master/ cp zapache /usr/local/bin/ #拷贝 ll zapache -rwxr-xr-x 1 root root 6110 11月 29 15:21 zapache #查看权限 vim /usr/local/etc/zabbix_agentd.conf #指定对应目录 Include=/usr/local/etc/zabbix_agentd.conf.d/
最后导入模版!!
cd zapache-master/ #里面的zapache-template.xml为apache模版导入即可
服务端测试 [root@zabbix bin]# zabbix_get -s 127.0.0.1 -p 10050 -k zapache[BusyWorkers] 1
模版链接:http://pan.baidu.com/s/1o8U6qWa 密码:wf3y
转载请注明:暖风 » Zabbix 监控Apache