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
add-new-cloudera-hortonworks-hadoop-host-into-nagios-1
               
sudo vi /etc/nagios/nrpe.cfg

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

allowed_hosts=127.0.0.1,10.132.224.168

Save and exit
:wq
              
               
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
                

 
create-hostname-file-nagios-cloudera
Add in the following configuration into file
               
define host {
        use                             linux-server
        host_name                       slave1 
        alias                           slave1 configuration with nagios server
        address                         10.128.0.4
        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
   :wq
                

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