Page 1 of 1
Command timeout
Posted: Thu Nov 14, 2019 3:42 pm
by Milthiade
Hi,
I execute a remote custom script that might take some time to execute. For that purpose I've set a custom check_nrpe command with a 240 second timeout. From what I can see, it correct any Socket timeout after x seconds but now I have this error: Command XXXX didn't terminate within the timeout period 60s. I've been looking around but can't find where is this timeout located?
Thanks for the help
Carl
Re: Command timeout
Posted: Thu Nov 14, 2019 4:05 pm
by scottwilkerson
If this is a service check there is a default timeout in the nagios.cfg of 60 seconds under the directive of service_check_timeout
This is the max amount of seconds any service check can run.
Re: Command timeout
Posted: Thu Nov 14, 2019 4:57 pm
by Milthiade
Already set this option to 240 but I still get that 60 seconds error. This is a service check.
It run a powershell script on the remote server which run fine if called locally but it takes some time to run.
Re: Command timeout
Posted: Thu Nov 14, 2019 5:09 pm
by scottwilkerson
Milthiade wrote:Already set this option to 240 but I still get that 60 seconds error. This is a service check.
It run a powershell script on the remote server which run fine if called locally but it takes some time to run.
Ok, there are also setting in your nsclient.ini
You might have some timeouts in the wrapped script etc.
If you cannot figure it out, I would need to see the nsclient.ini from the remote server
Re: Command timeout
Posted: Fri Nov 15, 2019 10:15 am
by Milthiade
here's the nsclient... just removed the ip part.
I've already set 2 parameters for the timeout...
timeout = 240 and also command_timeout = 240
Not quite sure if there's any other to add.
For the script itself, there's no problem running it alone in powershell or starting it from a command prompt.
Re: Command timeout
Posted: Fri Nov 15, 2019 10:35 am
by scottwilkerson
I think you need one more section
Code: Select all
[/settings/external scripts]
timeout = 240
Also, what version of NSClient++ are you using?
Re: Command timeout
Posted: Fri Nov 15, 2019 10:53 am
by Milthiade
yes that did the trick.It was missing that section. I thought the first timeout would be for everything but I guess not. Is there a global timeout setting or does it have to be in each section?
thanks for the help
Re: Command timeout
Posted: Fri Nov 15, 2019 10:56 am
by scottwilkerson
Milthiade wrote:yes that did the trick.It was missing that section. I thought the first timeout would be for everything but I guess not. Is there a global timeout setting or does it have to be in each section?
thanks for the help
I believe
/settings/external scripts has it's own timeout, I don't believe it pulls globally.