首先到官方网站(http://www.nagios.org/download/)去下载最新的nagios软件包,本文中使用的是nagios-2.9.tar.gz 。
1、 nagios用户
mkdir /usr/local/nagios
chown nagios.nagios /usr/local/nagios
/usr/sbin/usermod -G nagcmd apache #apache的用户名
/usr/sbin/usermod -G nagcmd nagios
#变量prefix 为安装目录,例如/usr/local/nagios
#变量someuser 为nagios的用户,例如nagios
#变量somegruop 为nagios属于的组,例如nagios
#变量cmdgroup 为nagios命令行属组,例如nagcmd
make install
make install-config
make install-init
bin etc sbin share var #看到这5个目录就ok了
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
http://IP/nagios