服务端安装:
tar xzvf nagios-3.3.1.tar.gz
cd nagios
/usr/sbin/useradd nagios -s /sbin/nologins
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd nobody
./configure –with-command-group=nagcmd –with-httpd-conf=/usr/local/apache/conf/ –with-gd-lib=/usr/lib –with-gd-inc=/usr/include/
make all
make install
make install-init
make install-commandmode
make install-config
make install-classicui
/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin

tar xzvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure –with-nagios-user=nagios –with-nagios-group=nagios –enable-redhat-pthread-workaround

[root@test etc]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
[root@test etc]# /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
[root@test etc]# /usr/local/nagios/bin/nagios -s /usr/local/nagios/etc/nagios.cfg
[root@test etc]# /usr/local/nagios/bin/nagios -sp /usr/local/nagios/etc/nagios.cfg

[root@test conf]# vim httpd.conf
ScriptAlias /nagios/cgi-bin /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

Alias /nagios /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
#
# Directives to allow use of AWStats as a CGI

客户端安装:
cd /opt/
tar xzvf nrpe-2.12.tar.gz
groupadd nagios
useradd nagios -g nagios -d /usr/local/nagios/ -s /sbin/nologin
mkdir -p /usr/local/nagios/etc
mkdir /usr/local/nagios/bin
mkdir /usr/local/nagios/libexec
chown -R nagios.nagios /usr/local/nagios/etc/
cd nrpe-2.12
./configure
make all
make install-plugin
cp ./sample-config/nrpe.cfg /usr/local/nagios/etc/
cp src/nrpe /usr/local/nagios/bin/

cd ..
tar xzvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure –with-nagios-user=nagios –with-nagios-group=nagios –enable-redhat-pthread-workaround
make
make install

发表评论

电子邮件地址不会被公开。 必填项已用*标注