#!/bin/bash
#Plugins_nrpe.sh
#yum install -y wget gcc glibc glibc-common gd gd-devel make net-snmp net-snmp-utils openssl openssl-devel xinetd
cd /tmp/
useradd nagios
wget http://nchc.dl.sourceforge.net/project/nagiosplug/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz
wget http://192.168.94.131/nagios-plugins-1.4.16.tar.gz
wget http://192.168.94.131/nrpe-2.13.tar.gz
tar zxvf nagios-plugins-1.4.16.tar.gz
tar zxvf nrpe-2.13.tar.gz
cd /tmp/nagios-plugins-1.4.16
./configure
make && make install
chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec
cd /tmp/nrpe-2.13
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
sed -i 's@allowed_hosts=127.0.0.1@allowed_hosts=127.0.0.1,192.168.94.131@' /usr/local/nagios/etc/nrpe.cfg
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
echo "/etc/init.d/nagios start
/etc/init.d/httpd start
/etc/init.d/snmpd start
/etc/init.d/xinetd start
sh /root/iptables.rules
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >>/etc/rc.local
netstat -tnlp | grep nrpe
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
Plugins_nrpe.sh
最新推荐文章于 2021-05-12 20:08:00 发布