tar xf nagios-4.0.7.tar.gz
cd nagios-4.0.7
./configure --prefix=/service/nagios --datadir=/service/apache2.2/htdocs/nagios --sysconfdir=/service/nagios/etc --with-gd-lib=/service/common/gd2/lib --with-gd-inc=/service/common/gd2/include --with-command-group=nagcmd --enable-event-broker
make all
make install
make install-init
make install-commandmode (安装nagios相关命令)
make install-config (安装配置nagios文件)
make install-webconf (安装web接口,供访问nagios程序)
tar xf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
./configure --prefix=/service/nagios --datadir=/service/apache2.2/htdocs/nagios --sysconfdir=/service/nagios/etc --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
<Directory "/service/nagios/sbin">
# 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 /service/nagios/etc/nagios.users
Require valid-user
</Directory>
Alias /nagios "/service/apache2.2/htdocs/nagios"
<Directory "/service/apache2.2/htdocs/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 /service/nagios/etc/nagios.users
Require valid-user
</Directory>