Nagios安装:
安装组件:Yum –y instsll httpd gcc glibc glibc-common* gd* php php-mysql mysql mysql-server
添加用户与组:
useradd nagios
groupadd nagios
useradd –G nagios nagios
安装nagios:
Tar zxvf nagios-3.2.1.tar.gz
Cd nagios-3.2.1
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
Make all
make install
Make install-init
Make install-commmode
Make-install-config
Make install-webconf
添加apache支持
vi /usr/local/apache2/conf/httpd.conf
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<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
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
Require valid-user
</Directory>
/usr/local/apahce/bin/apachectl restart //重启apache