Mike Weber's presentation on using Nagios with NRPE.
The presentation was given during the Nagios World Conference North America held Sept 25-28th, 2012 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/nwcna
2. NRPE Concepts
Agent Required on Client
* plugin or script executes locally
* daemon runs on client (port 5666)
Nagios
* check_nrpe connects to client
Direct Checks
* connect and collect data from client
Indirect Checks
* connect to client, execute plugin to connect to second client
2012 2
5. NRPE Components: Client
NRPE Daemon
* daemon managed by xinetd
* security based on allowed_hosts
* runs on port 5666
* open firewall
NRPE Commands File (nrpe.cfg)
* check_nrpe connects to client
* command definitions
Plugins
* connect and collect data from client
2012 5
6. NRPE Components: Server
One Plugin
* check_nrpe (installed by default in XI)
Host and Service Definitions
* define the host
* define each service
2012 6
14. Why Compile NRPE and Plugins?
Eliminate Variables Across Distribution
* same daemon settings and location
* same nrpe definitions
* same commands locations and configuration (nrpe.cfg)
* same location for plugins
* same versions
Uniform Troubleshooting
* standards across distributions
* easier for multiple administrators
Uniform Upgrades
* method of upgrade the same
* upgrades will be the latest
2012 14
15. NRPE: Install Script
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cd /tmp
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz/download
tar zxvf nrpe-2.13.tar.gz
cd nrpe-2.13
yum install -y mod_ssl openssl-devel xinetd gcc make
./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib
make
make install
make install-daemon
make install-daemon-config
make install-xinetd
cp sample-config/nrpe.cfg /usr/local/nagios/etc/
2012 15
16. Plugins: Install Script
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cd /tmp
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins-
1.4.16.tar.gz/download
yum install -y gcc make mysql-devel mysql net-snmp
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
tar zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
exit 0
2012 16