配置nagios被监控机
操作方法:
1. 在nagios服务器(以下称为监控机)和被监控机上部署
安装nrpe (监控机也安裝) tar ‐zxvf nrpe‐***.tar.gz
cd nrpe‐2.8.1
./configure
make all
make install‐plugin
make install‐daemon
make install‐daemon‐config
/usr/local/nagios/libexec/check_nrpe ‐H localhost
和
安装nagios插件 tar ‐zxvf nagios‐plugins‐***.tar.gz
cd nagios‐plugins‐***
./configure
make
make install
chown nagios.nagios /usr/local/nagios
chown ‐R nagios.nagios /usr/local/nagios/libexec
客户端: 客户端配置
所有机器都需要配置:
安装XINETD服务
yum -y install xinetd
chkconfig xinetd on
service xinetd start
添加nagios用户useradd -s /sbin/nologin nagios
1. 安装nrpetar zxvf nrpe-2.12.tar.gz
./configure && make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
配置nrepvi /etc/xinetd.d/nrpe
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
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 = 127.0.0.1 serverip
}
3.添加端口
vi /etc/services 在最后添加
nrpe 5666/tcp #nrpe
4.重新启动Xinetd服务
/etc/init.d/xinetd restart
netstat -na | grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
5.安装Nagios的插件nagios-plugin
tar zxvf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure
make && make install