How to add cloudera or hadoop or hortonworks hosts into nagios

In this section you will learn How to add cloudera or hadoop or hortonworks hosts into nagios for monitoring.
On a server that you want to monitor, install the EPEL repository: ssh to hosts and be the root user
sudo -i
sudo yum install epel-release
Now install Nagios Plugins and NRPE:
sudo yum install nrpe nagios-plugins-all

Edit nrpe.cfg
sudo vi /etc/nagios/nrpe.cfg

Find the allowed_hosts directive, and add the private IP address of your Nagios server


Save and exit
Restart NRPE to put the change into effect:
sudo systemctl start nrpe.service
sudo systemctl enable nrpe.service
have to add these hosts to your Nagios server configuration before it will start monitoring them.

ssh to nagios main server and be root user

sudo -i

Add Host to Nagios Configuration - Create your hostname file
sudo vi /usr/local/nagios/etc/servers/yourhost1.cfg

Add in the following configuration into file
define host {
        use                             linux-server
        host_name                       slave1 
        alias                           slave1 configuration with nagios server
        max_check_attempts              5
        check_period                    24x7
        notification_interval           30
        notification_period             24x7

define service {
        use                             generic-service
        host_name                       slave1
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%

   save and exit

Reload service for new configuration and login to nagios server
sudo systemctl reload nagios.service