Share, , Google Plus, Pinterest,

Print

Posted in:

Socket timeout after 10 seconds – Nagios

If you are using Nagios as your Infrastructure Monitoring Tool, i am sure you have already seen or got the error “CRITICAL – Socket timeout after 10 seconds“.

What does “CRITICAL – Socket timeout after 10 seconds” error indicate?

This error does NOT necessarily indicate there is a problem with the host you are monitoring!

In most cases “CRITICAL – Socket timeout after 10 seconds” is a false positive alarm and means, that Nagios failed to get the reply from the host being monitored in certain amount of time.

By default Nagios “Socket timeout” is set to 10 seconds which means, if Nagios does not get the reply from monitored host in 10 seconds it will mark the Service as “CRITICAL – Socket timeout after 10 seconds“.

Sometimes System Admins are forced to use some Nagios customized plugins/checks, that take a bit more time to process and thus Nagios might produce/send false alarms like “CRITICAL – Socket timeout after 10 seconds“…

Socket timeout after 10 seconds
Socket timeout after 10 seconds

How to fix “CRITICAL – Socket timeout after 10 seconds” error?

We can fix this by increasing the “Socket timeout” value from the default 10 seconds to let’s say 20.

We can do this by adding a parameter to a specific command defined in commands.cfg file on your Nagios server. Commands.cfg file is usually located at /usr/local/nagios/etc/objects/commands.cfg (if you compiled Nagios) or /etc/nagios/commands.cfg (if you installed Nagios from RPM).

Read more about commands.cfg in my post “Nagios configuration – How to configure Nagios” post.

BEFORE (/usr/local/nagios/etc/objects/commands.cfg):

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

AFTER (/usr/local/nagios/etc/objects/commands.cfg):

define command {
 command_name    check_nrpe
 command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 20
 }

There are also other commands that support the “-t” parameter! Be sure to add a “-t 20” parameter to the command you had “CRITICAL – Socket timeout after 10 seconds” problems with 🙂

  • Thank you for this article!
    And greedings from Austria.

    • Mitch

      Hello Rene! Thanks for your support from Austria! 🙂 Have fun “neighbour”!

  • Navneet Patel

    Hello Mitch.. I have same issue.. i have changed the timeout value to 50 but now error message shows “socket timed out after 50 seconds.. so then i have set it for 100 sec and also few others greater than 60 seconds.. but error shows “socket timed out after 60 second ” even i have set it for > 60 seconds ….. Is it 60 second is maximum timeout ? if yes then where we can set it larger size then 60 seconds. and yes the error msg is shown only when i add service for check_postgres.. i.e check_postgres_database_stats, check_database_size etc… but for the service like check_load, check_users, check_ssh, check_tot_proc it will work.

    • Mitch

      I think maximum timeout value is set in nagios global configuration file. Please check. Regards, Mitch

  • great one , you pointed it this one is not related to server this is because of replay form client response . ..I got the error while is use pop3 monitoring smtp service get replayed

  • Luis

    Disculpe tengo los mismo problemas ya le agregue mas tiempo pero sigue igual no mejoria y me gustaria saber que puedo hacer sobre el problema de CRITICAL – Socket timeout after 10 seconds

  • narasimha

    Thanks….

    you are awesome….