Nagios NRPE | Monitoring hosts
In this section we will be configuring our nagios machine to start monitoring the remote machines. I will first show you on how to monitor remote hosts with nagios without any adons to remote hosts. Of course this means that you must have a functional Nagios server.
Nagios remote client installation
Nagios client installation | RHEL 3
# yum -y install net-snmp net-snmp-utils
# wget http://packages.sw.be/fping/fping-2.4-1.b2.1.el3.rf.i386.rpm
# wget http://packages.sw.be/nagios-plugins/nagios-plugins-1.4.9-1.el3.rf.i386.rpm
# wget http://packages.sw.be/nagios-nrpe/nagios-plugins-nrpe-2.5.2-1.el3.rf.i386.rpm
# wget http://packages.sw.be/nagios-nrpe/nagios-nrpe-2.5.2-1.el3.rf.i386.rpm
# wget http://packages.sw.be/nagios/nagios-devel-3.0.6-1.el3.rf.i386.rpm
# wget http://packages.sw.be/nagios/nagios-3.0.6-1.el3.rf.i386.rpm
# rpm -ivh nagios-3.0.6-1.el3.rf.i386.rpm
# rpm -ivh fping-2.4-1.b2.1.el3.rf.i386.rpm
# rpm -ivh nagios-plugins-1.4.9-1.el3.rf.i386.rpm
# rpm -ivh nagios-plugins-nrpe-2.5.2-1.el3.rf.i386.rpm
# rpm -ivh nagios-nrpe-2.5.2-1.el3.rf.i386.rpm
# chkconfig nrpe on
# service nrpe start
# chkconfig nagios off
# service nagios stop
Nagios Client installation | CentOS please refer to nagios installation for more details.
# yum install nagios nagios-plugins nagios-plugins-nrpe nagios-devel nagios-nrpe
# chkconfig nrpe on
# service nrpe start
# chkconfig nagios off
# service nagios stop
Nagios remote hosts monitoring
The example below is monitoring web service with Nagios Server without the use of NRPE.
define service{
use generic-service
host_name test-server
service_description HTTP
check_command check_http!-t 5 -p 8000
}
Nagios NRPE monitoring
On Nagios Server Please add the following lines in command.cfg this will allow the communication of local and remote nrpe nagios plugin.
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Your client's firewall must allow npre port 5666 communication.
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT
In remote host wherein nagios will monitor, check if nrpe port is listening.
netstat -ntlp | grep 5666
It must returne something like this:
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 23530/nrpe
Remote host sample nrpe.cfg entry. Then restart nrpe daemon.
command[check_tns]=/usr/lib/nagios/plugins/check_oracle --tns <local Oracle SID>
command[check_applsysd]=/usr/lib/nagios/plugins/check_oracle --tablespace NPRE oracle-user oracle-password APPLSYSD 90 80
Nagios Server entry. Then restart nagios server daemon.
define service{
use generic-service
host_name oracle-server
service_description TNS
check_command check_nrpe!check_tns
}
Using check_oracle Nagios plugin
I find a difficult time in solving the issues with this plugin. I did install Oracle clients in Nagios Server, installed Oracle server in Nagios server but nothing works. Then I reached into a conclusion of just exporting the environment of the remote host Oracle machine directly to it plugin :)
Please add this directly to check_oracle (remote host)
export ORACLE_HOME=<path of Oracle home>
export ORACLE_SID=<Oracle SID>
export TNS_ADMIN=<Oracle TNS Admin path>
Note that nagios user must be a group member of oracle user for nrpe to work properly. It might be oinstall or dba.
Thats it! Enjoy.
Tell a friend

