Remember, these are *SAMPLE* config files. You'll need to read
the documentation for more information on how to actually define
services, hosts, etc. to fit your particular needs.
[root@Nagios nagios]# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
*** Nagios/Apache conf file installed ***
8.配置web认证
[root@Nagios nagios]# vi /etc/httpd/conf.d/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.
# 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 /usr/local/nagios/etc/htpasswd.users
Require valid-user
Alias /nagios "/usr/local/nagios/share"
[root@Nagios nagios]# htpasswd -cb /usr/local/nagios/etc/htpasswd.users oldboy 123456 #创建登录nagios的web用户名和密码
Adding password for user oldboy
9.安装nagios插件
[root@Nagios tools]# yum -y install perl-devel
[root@Nagios tools]# tar xf nagios-plugins-1.4.16.tar.gz
[root@Nagios tools]# cd nagios-plugins-1.4.16
[root@Nagios nagios-plugins-1.4.16]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-perl-modules
[root@Nagios nagios-plugins-1.4.16]# make && make install
[root@Nagios nagios-plugins-1.4.16]# ll /usr/local/nagios/libexec/|wc -l
60 #此处为60-61个左右
[root@Nagios nagios-plugins-1.4.16]# cd ../
10.安装nrpe
[root@Nagios tools]# tar xf nrpe-2.12.tar.gz
[root@Nagios tools]# cd nrpe-2.12
[root@Nagios nrpe-2.12]# ./configure
[root@Nagios nrpe-2.12]# make all
[root@Nagios nrpe-2.12]# make install-plugin
[root@Nagios nrpe-2.12]# make install-daemon
[root@Nagios nrpe-2.12]# make install-daemon-config