前面介绍了zabbix3.0.3环境及相关监控项的添加,下面介绍下针对apache的监控配置:
1)在apache配置文件中打开server-status状态访问功能(自带的)

[root@IDC-Admin-01 ~]# /data/apache/bin/httpd -vServer version: Apache/2.4.25 (Unix)Server built:   Jun 19 2017 19:18:00[root@IDC-Admin-01 ~]# cat /data/apache/conf/httpd.conf|grep status    //确保apache支持status查询功能LoadModule status_module modules/mod_status.so [root@IDC-Admin-01 ~]# cat /data/apache/conf/httpd.conf|grep httpd-info.conf       Include conf/extra/httpd-info.conf                //打开这一行的注释 [root@IDC-Admin-01 ~]# cat /data/apache/conf/extra/httpd-info.conf.........<Location /server-status>    SetHandler server-status    Order deny,allow    Allow from all</Location> ## ExtendedStatus controls whether Apache will generate "full" status# information (ExtendedStatus On) or just basic information (ExtendedStatus# Off) when the "server-status" handler is called. The default is Off.#ExtendedStatus On [root@IDC-Admin-01 ~]# /data/apache/bin/httpd -k restart      //重启apache服务 然后就可以访问apache的状态页面了[root@IDC-Admin-01 ~]# curl http://localhost/server-status[root@IDC-Admin-01 ~]# curl http://localhost/server-status?autolocalhostServerVersion: Apache/2.4.25 (Unix) OpenSSL/1.0.2l PHP/5.6.30ServerMPM: event...........ConnsTotal: 2ConnsAsyncWriting: 0ConnsAsyncKeepAlive: 1ConnsAsyncClosing: 1Scoreboard: ___________________________________________________________________________________________W________............................................................................................................................................................................................................................................................................................................TLSSessionCacheStatusCacheType: SHMCBCacheSharedMemory: 512000CacheCurrentEntries: 6.......

2)编写apache状态监控脚本

[root@IDC-Admin-01 ~]# ll /data/zabbix/monitor_scripts/zapache.sh-rwxr-xr-x 1 zabbix zabbix 6.0K 6月  25 01:47 /data/zabbix/monitor_scripts/zapache.sh[root@IDC-Admin-01 ~]# cat /data/zabbix/etc/zabbix_agentd.conf|grep Include### Option: IncludeInclude=/data/zabbix/etc/zabbix_agentd.conf.d/[root@IDC-Admin-01 ~]# cat /data/zabbix/etc/zabbix_agentd.conf.d/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[*],/data/zabbix/monitor_scripts/zapache.sh \$1[root@IDC-Admin-01 ~]# /etc/init.d/zabbix_agentd restart

apache脚本和监控模块下载地址:https://pan.baidu.com/s/1eRBKEcE          (提取密码:nxs5)

3)在zabbix界面里导入apache监控模块

接着在“主机”的模块里添加apache模块(对应模块的监控图形可以自己根据需要进行添加或移除)

点击“添加”,就能看到该监控项的所有图形了。

©著作权归作者所有:来自51CTO博客作者80民工的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. 利用 r2 逆向分析框架分析 Windows Minidumps
  2. 80 多个 Linux 系统管理员必备的监控工具
  3. Netdata---Linux系统性能实时监控平台部署记录
  4. memcached程序端口监控脚本
  5. ngx_pagespeed-nginx前端优化模块介绍
  6. 使用shell脚本监控Linux主机
  7. zabbix监控交换机、防火墙等网络设备
  8. Linux下smokeping网络监控环境部署记录
  9. Oracle索引的监控

随机推荐

  1. Android Property System
  2. 【Android UI】色板
  3. AndroidщАЪш┐ЗViewPagerхоЮчО
  4. 在eclipse中查看Android(安卓)SDK源代码
  5. 2013.10.14 “?android ”
  6. 默认的Android(安卓)Dialog 样式
  7. Android仿计算器布局代码
  8. Android SdCard写入权限
  9. jQ.Mobi源代码
  10. Android 自定义progressbar