Socket Timeout after 10 Seconds

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Socket Timeout after 10 Seconds

Post by amitgupta19 »

I added a new server to the Monitoring and immediately it started giving the following Error:

CRITICAL - Socket timeout after 10 seconds

Currently i am monitoring the following services: CPU Load, C Drive, Up Time and memory usage and all the services are giving the same Error.

Please suggest How to correct it?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Socket Timeout after 10 Seconds

Post by dwhitfield »

Are you using NRPE? If so, please take a look at https://support.nagios.com/kb/article/n ... conds.html

Also, please post the nrpe.cfg from the remote machine as an attachment (and /etc/xinetd.d/nrpe, if you have it). Also, please post the output from the remote server of ps -aef | grep nrpe in a code block.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Socket Timeout after 10 Seconds

Post by amitgupta19 »

Remote Host is a Windows Server.

I am using the NSClient to fetch the data from the remote host.
dwasswa

Re: Socket Timeout after 10 Seconds

Post by dwasswa »

Hi @ amitgupta19 ,

Please go to your windows host and open the nsclient.ini file.

In that file go to the line

Code: Select all

allowed hosts = 127.0.0.1,::1,<your nagios ip goes here>
and make sure your nagios ip is included. if not, please do include it.

After making those changes,please restart the NSClient service on your windows machine. Please make sure its running.

Also,go to your firewall on nagios server and make sure that port 12489 is open.

Here is also a guide on configuring NSClient...https://assets.nagios.com/downloads/nag ... 1493223405

Please confirm those and give me an update.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Socket Timeout after 10 Seconds

Post by amitgupta19 »

I have checked and made the suggested changes.

But still same error.

Please suggest.
dwasswa

Re: Socket Timeout after 10 Seconds

Post by dwasswa »

Hi @amitgupta19,


Please post how you defined your check command for those services. For example:

check_nt!xxx xxx xxxx or check_nrpe!xxx xxx xxxx

Where is your check command defined? Please send me the file.

It may be located at /usr/local/nagios/etc/objects/commands.cfg on your system, but you will need to locate it if your system is set up differently.

I would also like to see how your services are defined, so please send me the config file in which you have them defined.

Lastly, please attach your nsclient.ini file from your windows machine; I would like to check a few configurations.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Socket Timeout after 10 Seconds

Post by amitgupta19 »

I have attached all the Files

Please have a look.

It should be helpful for you.
Attachments
checkcommands.cfg
(25.87 KiB) Downloaded 662 times
nsclient.ini
(322 Bytes) Downloaded 568 times
services.cfg
(87.8 KiB) Downloaded 539 times
dwasswa

Re: Socket Timeout after 10 Seconds

Post by dwasswa »

Hi @ amitgupta19,

After looking into your checkcommands.cfg file, i noticed that you have your check_nt command defined wrong.

You need to specify port 12489 among the arguments with -p 12489. This is the port through which Nagios communicates with NSClient on windows.

That is why you are getting the

Code: Select all

 socket time out
Please see example for ideal check_nt command:

Code: Select all

# 'check_nt' command definition
define command{
        command_name    check_nt
        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489  -v $ARG1$ $ARG2$
        }
For more information about the check_nt command, please follow this link...check_nt_command

Please make the changes stated above, restart Nagios and let me know if that solves your issue.
dwasswa

Re: Socket Timeout after 10 Seconds

Post by dwasswa »

After looking into your checkcommands.cfg file, i noticed that you have your check_nt command defined wrong.



You need to specify port 12489 among the arguments with -p 12489. This is the port through which Nagios communicates with NSClient on windows.

That is why you are getting the

Code: Select all

 socket time out
Please see example for ideal check_nt command:

Code: Select all

# 'check_nt' command definition
define command{
        command_name    check_nt
        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489  -v $ARG1$ $ARG2$
        }

For more information about the check_nt command, please follow this link...check_nt_command

Secondly, after looking into your nsclient.ini file, I strongly suggest that you reinstall the NSClient agent. It did not have any configurations.

Please follow this kb article for information on installing NSCLient...Installing-The-Windows-Agent-NSClient

Please follow this kb article for information on configuring NSCLient...Configuring-The-Windows-Agent-NSClient

Please make the changes stated above, restart Nagios and let me know if that solves your issue.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Socket Timeout after 10 Seconds

Post by amitgupta19 »

@dwasswa

I changed the port option only for the CPU Load as suggested by you. But not working. Screenshot attached for your referrence.

I went through the link for the check_nt command.

It says that Port is optional.

Also all other servers are being monitored without any error, how come this is the only server requires the port to be specified.

Please suggest.
Attachments
Port Option.PNG
Port Option.PNG (10.77 KiB) Viewed 10325 times
Locked