Project

General

Profile

Setting up NRPE on Debian server » History » Revision 2

Revision 1 (Jamila Khan, 08/19/2014 04:56 PM) → Revision 2/6 (Jamila Khan, 08/19/2014 05:09 PM)

h1. Setting up NRPE on Debian server 

 {{>toc}} 

 Process: 

 h2. on client server 

 h3. Install NRPE 

  

 <pre> 
 aptitude install nagios-nrpe-server nagios-plugins-basic 
 </pre> 

 h3. Edit config file 

 <pre> 
 vim /etc/nagios/nrpe.cfg 
 </pre> 

 * Add IP_v4_of_Nagios_server to allowed_hosts 

 h3. start service 

 <pre> 
 service nagios-nrpe-server restart 
 </pre> 

 h3. check that service is running 

 <pre> 
 netstat -tpln | grep 5666 
 </pre> 

 h3. edit local config to add specified checks 

 <pre> 
 vim /etc/nagios/nrpe_local.cfg 
 </pre> 

 Add a NRPE test check and a in this instance I'm adding disk check. checks for all the disks 

 <pre> 
 0 octavia:/etc/nagios# cat nrpe_local.cfg  
 ###################################### 
 # Do any local nrpe configuration here 
 ###################################### 

 command[check_nrpe_daemon]=/bin/echo "NRPE OK" 

 # disk checks 
 command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/root 

 </pre> 

 h3. restart service 

 <pre> /dev/mapper/vg_octavia0-root 
 service nagios-nrpe-server restart command[check_disk_tmp]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vg_octavia0-tmp 
 </pre> 


 h2. on monitoring server 

 h3. test connection 

 On Nagios/Icinga server test that that worked: 

 <pre> command[check_disk_var]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vg_octavia0-var 
 /usr/lib/nagios/plugins/check_nrpe -H clientserveruri.com command[check_disk_mysql]=/usr/lib/nagios/plugins/check_disk -w 20% -c check_nrpe_daemon 10% -p /dev/mapper/vg_octavia0-var+lib+mysql 
 NRPE OK command[check_disk_home]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vg_octavia0-home 
 </pre> 

 h3. set up checks. 

 example service config file 

 <pre> 
 ############################################################################### 
 ############################################################################### 
 # 
 # SERVICE DEFINITIONS 
 # 
 ############################################################################### 
 ############################################################################### 

 define service{ 
         use                       generic-service           ; Inherit default values from a template 
         host_name                 clientserver 
         service_description       SSH 
         check_command             check_ssh 
         } 

 define service{ 
         use                       generic-service           ; Inherit default values from a template 
         host_name                 clientserver 
         service_description       HTTP 
         check_command             check_http 
         } 

 define service{ 
         use                       generic-service           ; Inherit default values from a template 
         host_name                 clientserver 
         service_description       Users 
         check_command             check_nrpe_1arg!check_users 
         } 

 define service{ 
         use                       generic-service           ; Inherit default values from a template 
         host_name                 clientserver 
         service_description       Load 
         check_command             check_nrpe_1arg!check_load 
         } 

 define service{ 
         use                       generic-service           ; Inherit default values from a template 
         host_name                 clientserver 
         service_description       Zombie Processes 
         check_command             check_nrpe_1arg!check_zombie_procs 
         } 

 define service{ 
         use                       generic-service           ; Inherit default values from a template 
         host_name                 clientserver 
         service_description       Total Processes 
         check_command             check_nrpe_1arg!check_total_procs 
         } 

 define service{ 
         use                       generic-service           ; Inherit default values from a template 
         host_name                 clientserver 
         service_description       Disk Space /root 
         check_command             check_nrpe_1arg!check_disk_root 
         } 
 </pre> 



 sources: 
 http://xmodulo.com/2014/03/nagios-remote-plugin-executor-nrpe-linux.html 
 https://wiki.icinga.org/display/howtos/Setting+up+NRPE+with+Icinga
Go to top