centos 6.5 zabbix3.0.4 监控apache
开启apache的server-status
httpd.conf 末尾添加
[root@test3 /]# vim /usr/local/httpd-2.2./conf/httpd.conf
ExtendedStatus On
<location /server-status>
SetHandler server-status
Order Allow,Deny
Allow from all
</location>
重启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/zabbix_agentd.conf
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
导入模板
关联模板
配置-主机(选择apache客户端)
模板-选择(选择上面导入的模板)-添加-更新
在web页面查看是否有数据
最新文章
- [转]Oracle10g数据库自动诊断监视工具(ADDM)使用指南
- 诅咒JavaScript之:Jquery ajax提交内容异常
- C# 特殊处理使用方法
- 03SpringMvc_自定义的spring.xml配置文件和逻辑视图名
- $.trim()函数
- Intent进行组件通信的一些体会
- C++智能指针初学小结
- android anim 动画效果
- java和C#之间SOCKET通信的问题
- 配置SAP 采购合同审批
- CSDN Androidclient开展(两):基于如何详细解释Java使用Jsoup爬行动物HTML数据
- Android简易实战教程--第十一话《获取手机所有应用信息Engine类详解》
- javascript js原生ajax post请求 实例
- Goland配置
- jQuery-4.动画篇---自定义动画
- 在windows下golang安装zmq3小记
- MySQL学习----unsigned 无符号的总结
- jQuery源码解读三选择器
- 把 Activity 改成 ListActivity继续使用 setContentView
- ViewDragHelper详解(侧滑栏)
热门文章
- 在linux下安装tesseract-ocr
- POJ3114 Countries in War (强连通分量 + 缩点 + 最短路径 + 好题)
- 利用mybatis的分页插件实现商品列表的显示
- OC之NSString、NSMutableString学习笔记 常用方法
- yum提示another app is currently holding the yum lock;waiting for it to exit
- Win7环境下Eclipse连接Hadoop2.2.0
- C#----对时间结构DateTime的使用(时间日期的使用)
- 一段发工资的shell代码
- Django基础,Day10 - template 模板引擎与路径设置
- C-基本语法与运算