分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

zabbix日常监控Apache2.4

发布时间:2023-09-06 01:59责任编辑:彭小芳关键词:暂无标签

Apache的安装请参考https://www.cnblogs.com/huangyanqi/p/9168637.html

  1、修改配置

[root@apache ~]# httpd -vServer version: Apache/2.4.6 (CentOS)Server built: ??Apr 20 2018 18:10:38[root@apache ~]# cat /etc/httpd24/httpd.conf |grep statusLoadModule status_module modules/mod_status.so[root@apache ~]# cat /etc/httpd24/httpd.conf |grep httpd-info.conf#Include /etc/httpd24/extra/httpd-info.conf注释:去掉这个注释[root@apache ~]# vim /etc/httpd24/extra/httpd-info.conf<Location /server-status> ???SetHandler server-status ???Order allow,deny ???Allow from localhost ???Allow from 122.114.200.186/32</Location>ExtendedStatus On注释:去掉前面的#注释

  2、浏览器查看

http://IP/server-status

  3、下载zabbix模板

[root@test3 /]# wget https://github.com/lorf/zapache/archive/master.zip [root@test3 /]# unzip master.zip [root@test3 /]# cd zapache-master/[root@test3 zapache-master]# lshttpd-server-status.conf.sample ???zapacheREADME.md ?????????????????????????zapache-template-active.xmluserparameter_zapache.conf.sample ?zapache-template.xml
注释: httpd-server-status.conf.sample 是用于配置server-status的上个步骤已经配置过了 ????userparameter_zapache.conf.sample 、zapache 关键的文件 ????zapache-template-active.xml ?zapache-template.xml模板

  4、把文件放置到相应位置

cp userparameter_zapache.conf.sample /etc/zabbix/zabbix_agentd.d/cd /etc/zabbix/zabbix_agentd.d/mv userparameter_zapache.conf.sample userparameter_zapache.conf[root@test3 zabbix_agentd.conf.d]# cat userparameter_zapache.conf UserParameter=zapache[*],/var/lib/zabbixsrv/externalscripts/zapache \$1修改下路径UserParameter=zapache[*],/etc/zabbix/scripts/zapache \$1#设置权限[root@agent ~]#chown root.zabbix /etc/zabbix/scripts/zapache [root@agent ~]#chmod 550 /etc/zabbix/scripts/zapache [root@agent ~]#ll /etc/zabbix/scripts/total 20-r-xr-x--- 1 root zabbix ?514 May 29 16:50 check_port1.sh-r-xr-x--- 1 root zabbix ?437 May 29 18:00 disk_scan.sh-r-xr-x--- 1 root zabbix 1044 Jun 11 14:25 nginx_zbx.sh-r-xr-x--- 1 root zabbix 6110 Jun 12 15:26 zapache#重启服务[root@agent ~]#systemctl restart zabbix-agent.service 

  5、zabbix-server导入模板

  6、导入模板

  7、结果如下

zabbix日常监控Apache2.4

原文地址:https://www.cnblogs.com/huangyanqi/p/9174561.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved