一:
安装nagios
  wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz
tar -xf nagios-3.2.3.tar.gz
cd nga
cd nagios-3.2.3
./configure --prefix=/usr/local/nagios/
make all
make install
make install-init
make install-commandmode
make install-config
chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --list nagios
安装nagios 插件
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
ls
mv nagios-plugins-1.4.15.tar.gz ~
cd ~
tar -xf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure --prefix=/usr/local/nagios/
make
make install

安装nagios汉化插件
wget http://nchc.dl.sourceforge.net/project/nagios-cn/sourcecode/zh_CN%203.2.3/nagios-cn-3.2.3.tar.bz2
ls
tar -xf nagios-cn-3.2.3.tar.bz2
cd nagios-cn-3.2.3
ls
./configure
make all
make install
安装apache PHP为了简便,直接yum了!

修改httpd.conf中的user group
在末尾添加如下,为了安全期间,需要增加验证配置,
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>

穿件apache目录验证文件,配置一个用户
[root@localhost nagios-cn-3.2.3]# htpasswd -c /usr/local/nagios/etc/htpasswd zhoutao
New password:
Re-type new password:
Adding password for user zhoutao
[root@localhost nagios-cn-3.2.3]# cat /usr/local/nagios/etc/htpasswd
zhoutao:pLXuqF7te5D5o

启动apache
service httpd start

访问nagios
http://serverip/nagios