开启apache的server-status
httpd.conf 末尾添加
[root@test3 /]# vim /usr/local/httpd-2.2.31/conf/httpd.conf
ExtendedStatus On
SetHandler server-status
Order Allow,Deny
Allow from all
重启apache
[root@test3 /]# /usr/local/bin/apachectl -t
Syntax OK
[root@test3 /]# /usr/local/bin/apachectl restart
浏览器http://localhost/server-status
或
[root@test3 /]# curl localhost/server-status 重启zabbix
[root@test3 /]# /etc/init.d/zabbix_agentd restart
Shutting down zabbix_agentd: [ OK ]
Starting zabbix_agentd: [ OK ]
下载模板
[root@test3 /]# wget https://github.com/lorf/zapache/archive/master.zip 解压
[root@test3 /]# unzip master.zip
Archive: master.zip
24a764b2e224f9b8d0a6bc94dcadd7568b2fe650
creating: zapache-master/
inflating: zapache-master/README.md
inflating: zapache-master/httpd-server-status.conf.sample
inflating: zapache-master/userparameter_zapache.conf.sample
inflating: zapache-master/zapache
inflating: zapache-master/zapache-template-active.xml
inflating: zapache-master/zapache-template.xml
[root@test3 /]# cd zapache-master/[root@test3 zapache-master]# ls
httpd-server-status.conf.sample zapache
README.md zapache-template-active.xml
userparameter_zapache.conf.sample zapache-template.xml
把文件放到相应的目录
[root@test3 zapache-master]# cp userparameter_zapache.conf.sample /usr/local/zabbix/etc/zabbix_agentd.conf.d/
[root@test3 zabbix_agentd.conf.d]# mv userparameter_zapache.conf.sample userparameter_zapache.conf
[root@test3 zabbix_agentd.conf.d]# 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
把zapache文件放到usr/local/bin
[root@test3 zabbix_agentd.conf.d]# cd /zapache-master/
[root@test3 zapache-master]# cp zapache /usr/local/bin/
查看是否有执行权限
[root@test3 bin]# ll zapache
-rwxr-xr-x 1 root root 6110 Sep 9 16:35 zapache
没有权限可执行下面命令
[root@test3 bin]# chmod +x zapache
修改zabbix -agentd.conf
[root@test3 bin]# vim /usr/local/zabbix/etc/ 导入模板
关联模板
配置-主机(选择apache客户端)
模板-选择(选择上面导入的模板)-添加-更新
在web页面查看是否有数据
本文转自:http://www.cnblogs.com/zzzhfo/p/5884795.html
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com