Page 1 of 2

CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 7:18 am
by Frédéric GRANAT
Hi,
I've got the following error while testing check_nrpe.
The command below works for another server.

[root@nagiosxi libexec]# ./check_nrpe -H <host>
CHECK_NRPE: Socket timeout after 10 seconds.

I already spent a lof of time trying to solve that ( increasing the timeout, modifying nrpe.cfg, ...etc).
Do you have any idea ?

Regards,

Frederic

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 8:02 am
by scottwilkerson
Can we first see if we can telnet to port 5666 from the Nagios server to rule out firewall or connectivity issues

Code: Select all

telnet <host> 5666

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 8:46 am
by Frédéric GRANAT
[root@nagiosxi libexec]# telnet W2K8-BACKUP02 5666
Trying 172.16.9.1...
Connected to W2K8-BACKUP02.cg.ahp (172.16.9.1).
Escape character is '^]'.

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 10:12 am
by scottwilkerson
Can you post your nrpe.cfg off of W2K8-BACKUP02

Also, how did you install NRPE? Was it one of our agent installers or from source?

If from source, did you enable ssl support?

thanks

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 10:21 am
by Frédéric GRANAT
Can you post your nrpe.cfg off of W2K8-BACKUP02
=> Could you please tell me where could I find the file nrpe.cfg on W2K8-BACKUP02 (I launched a search on C: without success)
Remark : I only have the nsclient++ installed on the server (I didn't know that nrpe was installed on it, I thought nrpe was only installed on Nagiosxi server).

Also, how did you install NRPE? Was it one of our agent installers or from source?
=> Are you talking abour nrpe on W2K8-BACKUP02 ou on nagiosxi server ?
Anyway, I didn't install nrpe by myself, I think It has been installed from source.

If from source, did you enable ssl support?
=> How could i check that ?

Rgds,

Frederic

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 10:33 am
by lmiltchev
Did you follow closely this document? Please, make sure the "NSC.ini" is modified appropriately.
You will have to restart the nsclient++ service after making changes to the "NSC.ini" file, so that the changes can take effect.

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 12:12 pm
by Frédéric GRANAT
Hi,
I've got 17 checks on the same server.
when doing netstat -a, it shows that there are at least 17 sessions on the remote server in close_wait state.
when I remove my checks, the sessions remains on the server.

I've got no problem on another server having the same number of checks (no sessions from nagiosxi on that server, whereas checks works !)

That seems to be the explanation of the problem.
The fact of adding the following block in NSC.ini doesn't solve the problem.

allowed hosts = 172.16.6.12
allow_arguments = 1
allow_nasty_meta_char = 1
port = 5666
use_SSL = 1

What could I do ?

Please find below a copy of my nsc.ini

; Undocumented section


[/modules]

; CheckDisk - CheckDisk can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckDisk = 1

; Event log Checker. - Check for errors and warnings in the event log. This is only supported through NRPE so if you plan to use only NSClient this wont help you at all.
CheckEventLog = 1

; Check External Scripts - A simple wrapper to run external scripts and batch files.
CheckExternalScripts = 1

; Helper function - Various helper function to extend other checks. This is also only supported through NRPE.
CheckHelpers = 1

; Check NSCP - Checkes the state of the agent
CheckNSCP = 1

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; CheckWMI - CheckWMI can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckWMI = 1

; NRPE server - A simple server that listens for incoming NRPE connection and handles them. NRPE is preferred over NSClient as it is more flexible. You can of cource use both NSClient and NRPE.
NRPEServer = 1

; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1


; Undocumented section
[/settings/default]

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
;allowed hosts = 172.16.6.12

; Section for NRPE (NRPEListener.dll) (check_nrpe) protocol options.
[/settings/NRPE/server]
allowed hosts = 172.16.6.12
allow_arguments = 1
allow_nasty_meta_char = 1
port = 5666
use_SSL = 1

; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]


; Section for system checks and system settings
[/settings/check/system/windows]


; Confiure which services has to be in which state
[/settings/check/system/windows/service mapping]


; Configure crash handling properties.
[/settings/crash]


; Section for the EventLog Checker (CheckEventLog.dll).
[/settings/eventlog]


; A set of options to configure the real time checks
[/settings/eventlog/real-time]


; A set of filters to use in real-time mode
[/settings/eventlog/real-time/filters]


; Section for external scripts configuration options (CheckExternalScripts).
[/settings/external scripts]


; A list of aliases available. An alias is an internal command that has been "wrapped" (to add arguments). Be careful so you don't create loops (ie check_loop=check_a, check_a=check_loop)
[/settings/external scripts/alias]


; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_messagerie1 = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Messagerie-Partie1" /w:1 /c:3
check_messagerie2 = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Messagerie-Partie3" /w:1 /c:3
check_applis = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Application Metiers" /w:1 /c:3
check_infrastructures = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Infrastructures" /w:1 /c:3
check_templates = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Templates" /w:1 /c:3
check_lvd = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-LVD" /w:1 /c:3
check_serveurs_w2k = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Serveurs Windows2000" /w:1 /c:3
check_preprod_windows = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-PreProduction Windows" /w:1 /c:3
check_applis_test = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Application Metiers TEST" /w:1 /c:3
check_salagon = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-SALAG" /w:1 /c:3
check_linux = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Linux" /w:1 /c:3
check_messagerie3 = cscript.exe //T:30 //NoLogo "scripts/check_veaam.vbs" "C:\ProgramData\Veeam\Backup" "_BKUP_-Messagerie-Partie2" /w:1 /c:3


; A list of wrappped scripts (ie. using the template mechanism)
[/settings/external scripts/wrapped scripts]

; A list of templates for wrapped scripts
[/settings/external scripts/wrappings]

; Configure log properties.
[/settings/log]


; Configure log file properties.
[/settings/log/file]


; Section for configuring the shared session.
[/settings/shared session]


; A list of avalible remote target systems
[/settings/targets]

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Thu Nov 29, 2012 12:49 pm
by lmiltchev
Try running the command both ways:

Code: Select all

./check_nrpe -H <host_name>
and

Code: Select all

./check_nrpe -H <IP_address>
Also, see if you can find any relevant info in the nsclient.log that can point us to the right direction, and post it.

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Fri Nov 30, 2012 2:49 am
by Frédéric GRANAT
[root@nagiosxi libexec]# ./check_nrpe -H W2K8-BACKUP02
CHECK_NRPE: Socket timeout after 10 seconds.
[root@nagiosxi libexec]# ./check_nrpe -H W2K8-SRVBACKUP
I (0,4,0,172 2012-05-08) seem to be doing fine...

It works for a server and doesn't work for another.

[root@nagiosxi libexec]# ./check_nrpe -H 172.16.9.1
CHECK_NRPE: Socket timeout after 10 seconds.

using the IP address doesn't change anything

And nothing in the nsclient.log on W2K8-BACKUP02

Rgds,

Frederic

Re: CHECK_NRPE: Socket timeout after 10 seconds

Posted: Fri Nov 30, 2012 10:17 am
by lmiltchev
Make sure you have these settings in the nsclient.ini file:

Code: Select all

; Configure log properties.
[/settings/log]

; DATEMASK - The size of the buffer to use when getting messages this affects the speed and maximum size of messages you can recieve.
date format = %Y-%m-%d %H:%M:%S

; FILENAME - The file to write log data to. Set this to none to disable log to file.
file name = ${exe-path}/nsclient.log

; LOG LEVEL - Log level to use. Avalible levels are error,warning,info,debug,trace
level = debug


; Configure log file properties.
[/settings/log/file]

; MAXIMUM FILE SIZE - When file size reaches this it will be truncated to 50% if set to 0 (default) truncation will be disabled
max size = 0


; Section for configuring the shared session.
[/settings/shared session]

; LOG LEVEL - Log level to use
enabled = true


; A list of avalible remote target systems
[/settings/targets]
Restart the nsclient++ service. Try to connect to the remote machine:

Code: Select all

./check_nrpe -H W2K8-BACKUP02
or

Code: Select all

./check_nrpe -H 172.16.9.1
and check the nsclient.log again. There has to be something in the log.

If this doesn't help, you can try uninstalling nsclient++ and re-installing it again on this machine.