Command timeout

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Milthiade
Posts: 7
Joined: Wed Jun 12, 2019 8:47 am

Command timeout

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command timeout

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Milthiade
Posts: 7
Joined: Wed Jun 12, 2019 8:47 am

Re: Command timeout

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command timeout

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Milthiade
Posts: 7
Joined: Wed Jun 12, 2019 8:47 am

Re: Command timeout

Post 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.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command timeout

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Milthiade
Posts: 7
Joined: Wed Jun 12, 2019 8:47 am

Re: Command timeout

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Command timeout

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked