Download and install repo packages:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Now start the procedure:
- Install the below packages
- # yum install nrpe nagios nagios-plugins-all
- # chkconfig nrpe on
- The nrpe configuration file is : /etc/nagios/nrpe.cfg
- Make the necessary changes to the nrpe config file, so that Nagios server can communicate to the client machine.
- # vim /etc/nagios/nrpe.cfg
- allowed_hosts= 127.0.0.1,<Nagios server IP address>
- Also, define the below commands in the same nrpe.cfg file as shown below. So that you can use them while adding these to Nagios server for monitoring:
- command[check_disk]=/usr/lib64/nagios/plugins/check_disk -w 10% -c 5% --local -X tmpfs -X none
- command[check_memory]=/usr/local/sbin/check_memory.pl -C -u -w 90 -c 95
- Save and exit
- Restart nrpe service after the modifications done to the nrpe.cfg file.
- # /etc/init.d/nrpe restart
- Check whether the port 5666 is listening on localhost (the machine in which NRPE agent is installed) or not.
- # netstat -an | grep 5666
- tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
- Check whether you are able to telnet to port 5666 from Nagios server or not
- # telnet <Client IP> 5666
- If telnet is not listening to port 5666 from Nagios server, then enable the port by writing below iptable rule:
- Stop iptables: # /etc/init.d/iptables stop
- Paste the below rule in the iptables file (# vi /etc/sysconfig/iptables)
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT
- Save and exit.
- Start iptables: /etc/init.d/iptables start
- Now check whether you are able to telnet to port 5666 from Nagios server or not
- # telnet <Client IP> 5666