7.编译并安装Nagios插件
展开Nagios插件的源程序包(nagios-plugins-1.4.16.tar.gz)
./configure--with-nagios-user=nagios --with-nagios-group=nagcmd
make
make install
8.启动nagios
chkconfig --add nagios #将nagios添加到服务中
chkconfig nagios on #开启该服务
chkconfig --list nagios #查看服务启动状态
#检查脚本正确性
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start
现在已经可以访问
9.安装nrpe
在被测主机上先安装nagios plugins,然后添加nagios用户。
tar xzvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
10.安装daemon
make install-daemon
make install-daemon-config
make install-xinetd
安装完毕后,可修改配置文件/usr/local/nagios/etc/nrpe.cfg,例如端口等
编辑/etc/xinetd.d/nrpe
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 192.168.30.200 #监控主机(nagios-core地址)