Page 1 of 1

Service Check timeout increase on single check

Posted: Sun Nov 12, 2017 11:28 pm
by gomatze
Good Morning,

is there a way to define a higher timeout Value for a single check?
I know that i can do it in the Nagios.cfg but this is than working for each and every check. I just want a longer timout for one specific check...

Re: Service Check timeout increase on single check

Posted: Mon Nov 13, 2017 1:26 am
by tacolover101
pending what your global vars are set to, some specific plugins allow you to set it at a plugin level.

another option is re-writing or adding a timeout feature to the plugin. i believe the 'timeout' command works for this purpose if you wanted to write a wrapper.

Re: Service Check timeout increase on single check

Posted: Mon Nov 13, 2017 10:43 am
by kyang
Thanks @tacolover101!

@gomatze, tacolover101 is correct. Which plugin are you using for that specific check?

Some plugins will allow for a timeout -t

Re: Service Check timeout increase on single check

Posted: Tue Nov 14, 2017 4:45 pm
by gomatze
The Plugin is a selfmade perlscript which checks the daily renewed /etc/Hosts File of our Enviroment against the configuration of Nagiosxi-Hosts and Returns new Hosts we might want to Monitor and every Kind of Changes applied to the /etc/Hosts which is not applied to the NagiosXI Host Configuration.
We have around 14000 devices in our System and the Plugin ist looking out for specific Hosts and trys if they answer to Ping.
That takes a while and Nagios breaks the Check normally after 60s.
Actually i have increased the timeout globally to 240s which i do not want it to wait in all executions of Plugins and checks...

Re: Service Check timeout increase on single check

Posted: Tue Nov 14, 2017 5:54 pm
by npolovenko
@gomatze, Looks like the only option, in this case, would be to define a timeout value inside the plugin. I recommend to take a look at some plugins on nagios exchnage or in /usr/local/nagios/libexec/ and try to implement the same timeout mechanism.

Re: Service Check timeout increase on single check

Posted: Wed Nov 15, 2017 6:08 pm
by gomatze
I seperatet the Functions of the Plugin into a Plugin and a Cronjob that provides a list for the Plugin to use.
Therefore i reduced the global timeout Value to normal and all is running smooth. Thanks a lot

Re: Service Check timeout increase on single check

Posted: Thu Nov 16, 2017 10:06 am
by kyang
Sounds good!

Did you have any more questions or are we okay to close this thread?

Re: Service Check timeout increase on single check

Posted: Wed Jan 17, 2018 1:20 am
by gomatze
Threat can be closed! Thanks a lot!