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.
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.
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.
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.
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.
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.
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?