Nagios监控apache的信息

步骤:
1、开启apache status
在httpd.conf文件中添加如下内容:
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from .xxx.com
</Location>
重新启动apache,记得先看看apache有status模块木油哦./apachectl –l|grep mod_status.c )
2、apache的脚本check_apachestatus.pl,来源于http://exchange.nagios.org/directory/Plugins/Web-Servers/Apache/check_apachestatus/details
3、测试脚本
[root@10.10.10.139 /usr/local/nagios/libexec]$ ./check_apachestatus.pl -H 10.10.10.138
OK 0.061489 seconds response time. Idle 125, busy 3, open slots 8064 | 125;0;0;2;1;0;0;0;0;0;8064
4、

添加command.cfg
# ‘check_apache’ command definition
define command{
command_name check_apache
command_line $USER1$/check_apachestatus.pl -H $HOSTADDRESS$ $ARG1$ $ARG2$
}
5、配置监控的服务项即可
define service {
use generic-service
service_description Apache status
check_command check_apache
}
6、nagios查看

7

 

此条目发表在Nagios分类目录。将固定链接加入收藏夹。