Page 1 of 1

customizing Check_Ping on NRPE

Posted: Tue Aug 14, 2012 6:12 pm
by eng_m_g
Dears,

I'm new in configuring nagios ,
first I have nagios servers called RH1 which is responsible for monitoring my locally HP servers and switches by ping and snmp
Then I decided to make another nagios server as master nagios and make RH1 as NRPE remote nagios
Lets's say that
master nagios IP is 1.1.1.1 (public IP)
Remote nagios IP is 2.2.2.2 (public IP) and 3.3.3.3 (private IP)
HP server which is connected to Remote nagios 3.3.3.10 (private IP)

I configured NRPE on both master and remote servers under Xinetd
From master nagios I can make direct checks for services on the remote nagios like (chek_disk,check_swap…etc) through NRPE
but I can't make indirect checks for service ping for HP server which is connected to remote host RH1 and it gave me:
CRITICAL > CHECK_NRPE: Socket timeout after 10 seconds.

My configuration are :

Remote nagios:
I have added the ip of master nagios on /etc/xinetd.d/nrpe ===> 1.1.1.1
I have added an 5666/tcp entry for nrpe daemon on /etc/services
Add command for ping in /usr/local/nagios/etc/nrpe.cfg as following: command[check_ping]=/usr/local/nagios/libexec/check_ping -H 2.2.2.2 -w 3000.0,80% -c 5000.0,100% -p 5

Master Nagios

1. I have added command definition to use the check_nrpe plugin on /usr/local/nagios/etc/commands.cfg
2. I have created host and service definition as following:

define host{
name RH1
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0
}

##################################################################################################
define host{
use RH1
host_name RH1
address 2.2.2.2
}
###################################################################################################
define hostgroup{
hostgroup_name MediaCity
alias RH1
members RH1
}
###################################################################################################
define service{
use generic-service
host_name RH1
service_description CPU Load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name RH1
service_description Current Users
check_command check_nrpe!check_users
}
define service{
use generic-service
host_name RH1
service_description /dev/mapper/VolGroup00-LogVol00 Free Space
check_command check_nrpe!check_sda1
}
define service{
use generic-service
host_name RH1
service_description Total Processes
check_command check_nrpe!check_total_procs
}

#############################################################
# HP Servers #
#############################################################
define host{
use generic-switch
host_name HP server
address 3.3.3.10
hostgroups MediaCity
}

#############################################
define service{
use generic-service
host_name HP server
service_description PING
check_command check_nrpe!check_ping!200.0,20%!600.0,60%
normal_check_interval 5
retry_check_interval 1
}
#############################################

Could you please find why I can't monitor the HP server from master nagios , and is there any faults in my configuration, u can modify any thing u see as I'm not expert :-)

Re: customizing Check_Ping on NRPE

Posted: Tue Aug 14, 2012 7:11 pm
by jsmurphy
are you able to also post your check_nrpe definition from commands.cfg?

Re: customizing Check_Ping on NRPE

Posted: Wed Aug 15, 2012 3:17 am
by eng_m_g
jsmurphy wrote:are you able to also post your check_nrpe definition from commands.cfg?


Dear jsmurphy,
FYI

# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

Re: customizing Check_Ping on NRPE

Posted: Wed Aug 15, 2012 6:07 pm
by jsmurphy
Hmmmm my initial hunch was that you were trying to pass arguments and that arguments were disabled on your remote NRPE instance... but it doesn't look like you are handling arguments anyway with your command definition.

Are you able to ensure logging is turned on for NRPE and run check_nrpe from the nagios server command line, once you get the "Time out" check /var/log/messages on your remote server and the NRPE daemon should tell you why it's rejecting the request.

Re: customizing Check_Ping on NRPE

Posted: Fri Aug 17, 2012 5:55 pm
by eng_m_g
jsmurphy wrote:Hmmmm my initial hunch was that you were trying to pass arguments and that arguments were disabled on your remote NRPE instance... but it doesn't look like you are handling arguments anyway with your command definition.

Are you able to ensure logging is turned on for NRPE and run check_nrpe from the nagios server command line, once you get the "Time out" check /var/log/messages on your remote server and the NRPE daemon should tell you why it's rejecting the request.

Dear jsmurphy ,

when i tried /usr/local/nagios/etc/libexc/check_nrpe -H <IP of NRPE client>
it replied with NRPE V.3 and i found logs on /var/log/messages
but when i tried /usr/local/nagios/etc/libexc/check_nrpe -H <IP of NRPE client> -c check_ping -H <IP of sever connected to NRPE serevr>
i got CHECK_NRPE:Socket timed out after 10 seconds , and there is no logs creatred

kindly advice

Re: customizing Check_Ping on NRPE

Posted: Sun Aug 19, 2012 6:50 pm
by jsmurphy
If there are no NRPE logs on the remote host and you have logging enabled in your remote NRPE config, then the check isn't even getting to the server and you may want to check any firewalls between your nagios server and the remote server.

The way you worded your reply though leads me to believe you may have checked the wrong servers log file.

Re: customizing Check_Ping on NRPE

Posted: Wed Aug 22, 2012 3:18 am
by eng_m_g
jsmurphy wrote:If there are no NRPE logs on the remote host and you have logging enabled in your remote NRPE config, then the check isn't even getting to the server and you may want to check any firewalls between your nagios server and the remote server.

The way you worded your reply though leads me to believe you may have checked the wrong servers log file.

Dear Jsmurphy,

thank you for your reply, i'd like to inform you that i don't have any firewall enabled

Re: customizing Check_Ping on NRPE

Posted: Sat Aug 25, 2012 7:00 am
by eng_m_g
hi guys ,
is there any updates please

Re: customizing Check_Ping on NRPE

Posted: Mon Aug 27, 2012 5:13 pm
by jsmurphy
If there are no logs on the remote host for NRPE, either you have logging disabled or the network traffic is not reaching the server... I can't render any further assistance until you diagnose why the traffic isn't reaching the server.