Skip to content

Instantly share code, notes, and snippets.

@liwh
Created February 20, 2014 07:45
Show Gist options
  • Save liwh/9108716 to your computer and use it in GitHub Desktop.
Save liwh/9108716 to your computer and use it in GitHub Desktop.
useradd nagios
mkdir -p /opt/install_file
cd /opt/install_file
scp 10.103.13.148:/opt/install_file/nagios-plugins-1.5.tar.gz /opt/install_file
scp 10.103.13.148:/opt/install_file/nrpe-2.15.tar.gz /opt/install_file
tar xvfz nagios-plugins-1.5.tar.gz
cd nagios-plugins-1.5
./configure --prefix=/opt/nagios
make && make install
chown nagios.nagios /opt/nagios
chown -R nagios.nagios /opt/nagios/libexec
cd ..
tar xvfz nrpe-2.15.tar.gz
cd nrpe-2.15
./configure --prefix=/opt/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
cd ..
cp /etc/xinetd.d/nrpe /etc/xinetd.d/nrpe.bak
cat /etc/xinetd.d/nrpe.bak | sed 's/127\.0\.0\.1/\0 10.103.13.148/' > /etc/xinetd.d/nrpe
cp /etc/services /etc/services.bak
echo "nrpe 5666/tcp #nrpe" >> /etc/services
scp 10.103.13.148:/opt/nagios/etc/nrpe.cfg /opt/nagios/etc/
service xinetd restart
/opt/nagios/libexec/check_nrpe -H 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment