Service Check Timed Out | Nagios

Периодически получали ошибку Service Check Timed Out при проверке Вин машины через NRPE (NSClient++). На хосте выполнялся скрипт проверки, выполнялся в течение, примерно 2-3 минут.

В логах примерно такое:

SERVICE ALERT: TASK;name_of_the_task;CRITICAL;HARD;3;(Service Check Timed Out)

Пытались изменить время проверки ключом -t:

$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 600

Результата не было. С настройками NSClient++ особо не игрались, но на проверяемой машине висели процессы в состоянии FIN_WAIT.

В результате наткнулся в сети на описание переменной в конфиге nagios:

Format: service_check_timeout=seconds
Example: service_check_timeout=60

This is the maximum number of seconds that Nagios will allow service checks to run. If checks exceed this limit, they are killed and a CRITICAL state is returned. A timeout error will also be logged.

There is often widespread confusion as to what this option really does. It is meant to be used as a last ditch mechanism to kill off plugins which are misbehaving and not exiting in a timely manner. It should be set to something high (like 60 seconds or more), so that each service check normally finishes executing within this time limit. If a service check runs longer than this limit, Nagios will kill it off thinking it is a runaway processes.

Увеличиваем значение переменной для решения проблемы с таймаутом.