1. 环境
nagios分为客户端与服务端
服务端(监控机)放在中控机上
客户端放在各个服务器上
服务端环境: centos7 10.0.0.111
客户端环境: Ubuntu16 10.0.0.141
2.服务端的安装
忘记了, 很久以前装的服务端
3. 客户端安装
安装plugins
apt install gcc openssl libssl-dev
wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
cd nagios-plugins-2.2.1/
./configure --prefix=/usr/local/nagios
make && make install
chown -R nagios.nagios /usr/local/nagios
安装nrpe
wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-3.2.1/nrpe-3.2.1.tar.gz
tar zxvf nrpe-3.2.1.tar.gz
cd nrpe-3.2.1
./configure
make all
make install
make install-plugin
make install-daemon
make install-config
make install-inetd
make install-init
vim /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,::1,10.0.0.111
service start nrpe
service enable nrpe
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 # NRPE v3.2.1
在服务端再测试一下
/usr/local/nagios/libexec/check_nrpe -H 10.0.0.141 # NRPE v3.2.1
..
网友评论