通过rpmforge来安装nagios,非常简单方便,shell文件如下:
#!/bin/bash
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm yum install httpd nagios nagios-plugins -y
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak cat >>/etc/httpd/conf/httpd.conf<<eof ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi" <Directory "/usr/lib/nagios/cgi"> # SSLRequireSSL
Options ExecCGI AllowOverride None Order allow,deny Allow from all # Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/htpasswd.users Require valid-user </Directory> Alias /nagios "/usr/share/nagios" <Directory "/usr/share/nagios"> # SSLRequireSSL
Options None AllowOverride None Order allow,deny Allow from all # Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/htpasswd.users Require valid-user </Directory> eof
htpasswd -c /etc/htpasswd.users nagiosadmin service httpd start service nagios start clear
echo "load "
|
nagios的配置:/etc/nagios
基它应该不用多说了
阅读(782) | 评论(0) | 转发(0) |