How to manage the 'Service Check Timed Out'

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
abulbulian
Posts: 5
Joined: Mon Jan 29, 2018 2:49 pm

How to manage the 'Service Check Timed Out'

Post by abulbulian »

I'm working with 3.2.3 version of NagiosCore and trying to find a solution to a SQL check that is taking longer than the allowed 60 seconds before it timeouts. The other constraint is I'd only like adjust the timeout length for a few SQL checks and not globally. I've read a previous post that mentioned using a '-t' to specify the seconds for the timeout value. But, it seems like that is not possible and you must change it globally in a cfg file?

Looking for some help on how I can accomplish this task. Worst case, maybe I can consumer the 'Service Check Timed Out' and not crit on it for the specifics checks?

thanks
abulbulian
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How to manage the 'Service Check Timed Out'

Post by dwhitfield »

The question is whether the slowness is on the nagios server or on the remote server. You will want to speak with the admin of the remote host.

As for the nagios server, how many checks are you running: Hosts+Services?

Take a look at https://assets.nagios.com/downloads/nag ... uning.html

After that, if you still have questions, take a look at https://assets.nagios.com/downloads/nag ... ios-XI.pdf . Now, unless you are running NDO you don't need to worry about the db. The XI-specific stuff of course doesn't apply, but the concepts are still going to be useful in maximizing the performance of your nagios performance.
abulbulian
Posts: 5
Joined: Mon Jan 29, 2018 2:49 pm

Re: How to manage the 'Service Check Timed Out'

Post by abulbulian »

Thanks for the response. The slowness is on the db end during a specific period when Oracle is gathering stats on some particular tables. The queries themselves are very low cost normally. It's going to take some time to partition the necessary tables and thus fix the problem on the db side. With that said, my thought was to increase the timeout to at least 3 minutes (check runs every 5 minutes), as stated, I only want to do this for a few queries. That is why I was looking at using -t, but I'm not sure that will work since the nagios global timeout setting has the last say?
abulbulian
Posts: 5
Joined: Mon Jan 29, 2018 2:49 pm

Re: How to manage the 'Service Check Timed Out'

Post by abulbulian »

Also, I not using Nagios Xi, but rather Nagios Core 3.2.3.
abulbulian
Posts: 5
Joined: Mon Jan 29, 2018 2:49 pm

Re: How to manage the 'Service Check Timed Out'

Post by abulbulian »

It basically comes down to can I use the -t parameter to specify a different non-defailt timeout for the running check (SQL query) or do I have to adjust a global setting? Once again for Nagios Core 3.x.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How to manage the 'Service Check Timed Out'

Post by dwhitfield »

What you could do is set the global timeout high, and then on all the non-db checks, set a local timeout. Whichever timeout is hit first wins. It's not that the -t doesn't work, it's just that it's not going to be the winner in the scenario you describe.
abulbulian
Posts: 5
Joined: Mon Jan 29, 2018 2:49 pm

Re: How to manage the 'Service Check Timed Out'

Post by abulbulian »

Ok, thanks, that is an option. I think this is the global value currently at 90, I need to change. Don't really see any others atm in files.

# TIMEOUT VALUES
# These options control how much time Nagios will allow various
# types of commands to execute before killing them off. Options
# are available for controlling maximum time allotted for
# service checks, host checks, event handlers, notifications, the
# ocsp command, and performance data commands. All values are in
# seconds.
service_check_timeout=90
.
.
.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How to manage the 'Service Check Timed Out'

Post by dwhitfield »

Yep, that's the one. You'll probably need to add -t to the checks. Just because they aren't there doesn't mean the check doesn't use it. Unfortunately, not all checks will necessarily use it. If you find a plugin that does not use the -t, and it is one of ours, we can certainly file a bug report.
Locked