-
下载
nagios
nagios-plugs nrpe
下载
apache
1
)
安装
apache
进入
tar
包解压路径
( zxvf
选项解压
jxvf
选项解压
)
cd
/usr/httpd-2.2.11
安装
./configure --prefix=/usr/local/apache
&& make && make install
在安装完
nagios
后在
/usr/local/apache/co
nf/
添加
ScriptAlias
/nagios/cgi-bin /usr/local/nagios/sbin
AuthType Basic
Options ExecCGI
AllowOverride None
Order
allow,deny
Allow from all
AuthName
AuthUserFile
/usr/local/nagios/etc/htpasswd
Require valid-user
Alias /nagios
/usr/local/nagios/share
AuthType Basic
Options None
AllowOverride None
Order
allow,deny
Allow from all
AuthName
AuthUserFile
/usr/local/nagios/etc/htpasswd
Require
valid-user
或者用
Include
/usr/nagios-3.06/sample-config/
方式添加
2)
安装
nagios
cd
/usr/nagios-3.0.6
(nagios
3.1
版本
tar
包有些问题,安装后不能访问目前建议使用低
版本
)
安装
a)
添加
n
agios
用户
adduser
nagios
b
)执行安装命令
./configure --prefix=/usr/local/nagios
make all
make install
make install-init
##This installs the init
make install-commandmode
make install-config
##
将初始的配置文件安装到
/usr/loca
l/nagios/etc
3
)安装
nagios-plugs
./configure
--prefix=/usr/local/nagios/ --enable-redhat-
pthread-workaround
(
此选项针对
redhat
)
make all
make
install
4
)安装
nrpe
测试本地
#
./configure --prefix=/usr/local/nagios
--enable-ssl
make all
make install-plugin
make install-daemon
make
install-daemon-config
Install the NRPE
daemon as a service under xinetd.
make
install-xinetd
Edit the
/etc/xinetd.d/nrpe file and add the IP address of
the monitoring server to the only_from
directive.
only_from =
127.0.0.1 210.51.4.114
Add the following entry for the NRPE
daemon to the /etc/services file.
nrpe 5666/tcp # NRPE
Restart
the xinetd service.
service xinetd
restart
5
)测试
nrpe<
/p>
情况
#
netstat
-at|grep
nrpe
tcp
0
0
*:nrpe
*:*
LISTEN
#
netstat
-an|grep
5666
tcp
0
0
0.0.0.0:5666
0.0.0.0:*
LISTEN
可以看到
5666
端口已经在监听了
6
)执行
/usr/local/nagios/libexec/check_nrpe
-H
localhost
测试
p>
nrpe
是否正常工作
< br>7
)执行下面命令检查
nagios
配置
/usr/local/nagios/bin/nagios
–
v /usr/local/nagios/etc/
7
)执行下面命令启动
nagios
/usr/local/nagios/bin/nagios
–
d /usr/local/nagios/etc/
8
)为
na
gios
登录界面添加用户及密码
/usr/local/apache/bin/htpasswd
–
c
/usr/local/nagios/etc/htpasswd nagios