Timeout exceeded with nscp-local

Hi,

we have a check on some Windows-servers that can run very long (more than a minute).
The check will be executed using nscp-local and, on the Windows-server, NSClient++
As the server was checked per NRPE it worked without any problem with:

vars.nrpe_timeout = 180s
timeout = 180s

Now it times out after 60 seconds.
I already tried to add timeout = 180s in the definition of nscp-local, but it didn’t helped.
Any idea?

We use Icinga2 2.10.3-2 on a Debian 10 server from Debian repositories and Icinga2 2.11.3 on the Windows-server.

Thanks a lot
Luca

Hi @queoadmin

does it help if you set the timeout in the local nsclient.ini?

[/settings/default]
timeout = 180
; ...
[/settings/external scripts]
timeout = 180

Hello @queoadmin,
I experience this problem too. Changing the timeout variable and the setting in the nsclient.ini file did not solve the problem. Setting the nscp_boot variable to ‘false’ solved the time out error for me. The NSClient++ service should get set to running at startup for this to work.

vars.nscp_boot = false

I hope this help.
Alex

Hi Alex,

unfortunately it does not seem to help… :frowning:
I always get Timeout exceeded after 60 seconds.

Any other idea?

Thanks
Luca

Sounds like:

I’d upgrade.

I guess your problem was different than mine. My check script would finish in around 10 seconds when ran locally on the Windows server. The ‘nscp_boot’ variable default value is set to ‘True’. From my understanding this would boot the NSClient application up and run the script. On my servers I have the NSClient++ application already in a running state at startup (no need to boot up). Because if this, my 10 second script would run longer than 60 seconds and I would receive timeout errors.

I guess your case is different. Your script runs locally longer than 60 seconds which is causing the timeout. No other suggestion from my end. I guess you need to look at writing a custom check command for your custom script.

Regards
Alex

Hi Alex,

Write a custom check command should not be a problem, but how can I increase the timeout in my custom command?
I only know the same way for the “normal” check command. And I already tried to add timeout = 180s to the definition of nscp-local.

Thanks
Luca

When I say write a custom check command, I was meaning to NOT use the ‘nscp-local’ check command and write your own custom check command. See here about setting up your own custom check command. You can set a custom time out attribute this way since your script normal runs longer than 60 seconds.

I hope this helps
Alex

Hi Alex,

what should the difference between “changing the settings for nscp-local” and “creating a new check using nscp.exe”?

Regards
Luca

You said earlier you already have a script that runs longer that 60 seconds. Instead or using the NSClient application (nscp-local check command using the NSClient application) to run the scripts with Icinga you could run the script stand alone.

@Al2Klimov provided a link to a NSClient timeout bug in older version of Icinga.

Write you own CheckCommand using your script and set the timeout to a larger value since NSClient is causing problems. A basic example of a CheckCommand is below.

object CheckCommand "your_custom_script" {
  command = [ "C:\\Program Files\\ICINGA2\\sbin\\your_custom_script.cmd" ]

timeout = 5m
}

Alex

Hi Alex,

Thank you for your answer.
I’m trying to write the check, but I have some problem…
I wrote:

object CheckCommand “check_eventlog” {
import “plugin-check-command”
command = [ "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -command “& ‘C:\Program Files\NSClient++\scripts\evtsumup3\query.ps1’” " ]
arguments = {
“” = {
value = “$evlog_server$”
order = -1
}
}
timeout = 180s
}

And I need to give the script a parameter, so I defined evlog_server.
Unfortunately when I try to check the service I get an error, since the parameter will be appended after the quote…

Could you suggest me how to correct the definition?

Thanks
Luca