Page 1 of 1

is it possible to serialize some checks?

Posted: Fri Nov 10, 2017 10:39 am
by ilsuonogiallo
Hi all,

I am trying to find out whether it is possible to tell Nagios to serialize only *some* service checks.

I am running NagiosĀ® Coreā„¢ Version 4.3.2 to monitor different hosts and services; a few service checks are quite "heavy" (they run some fairly complex powershell scritps on the same remote host), hence I would like to serialize only these checks.

Is it possible to tell Nagios that some service checks must be run serially, without forcing Nagios to seralize *all* service checks?
If not, is it possible to tell Nagios that any service checks *on a certain host* must be run serially?

Thanks
Andrea

Re: is it possible to serialize some checks?

Posted: Fri Nov 10, 2017 3:54 pm
by npolovenko
Hello, @ilsuonogiallo. MAXIMUM CONCURRENT SERVICE CHECKS can only be set to a certain number but you can't define it for separate services as far as I know. Take a look at this plugin: https://exchange.nagios.org/directory/P ... ti/details
You could run the two heavyweight checks through the plugin and have all the other checks run unserialized.

Re: is it possible to serialize some checks?

Posted: Mon Nov 13, 2017 5:51 am
by ilsuonogiallo
unfortunatly, that does not match completely my environment: these plugin output is quite long, hence folding all the checks in a single "service" and having the output truncated would be misleading and confusing

Re: is it possible to serialize some checks?

Posted: Mon Nov 13, 2017 11:10 am
by mcapra
I don't know of anything in Nagios Core that would support this.

I would think a trivial lockfile would be sufficient for this use case, but it would have to be implemented in the respective plugins' code. You'd also need to be mindful of waits in your code due to the service_check_timeout and host_check_timeout settings in the main nagios.cfg file. Assuming locking exists among the "special" plugins, If you wanted checks using those "special" plugins to completely lock Nagios Core, eg put everything else "on hold" until those checks resolve, there's some back-end commands you could leverage:

https://old.nagios.org/developerinfo/ex ... mand_id=67
https://old.nagios.org/developerinfo/ex ... mand_id=41
https://old.nagios.org/developerinfo/ex ... mand_id=68
https://old.nagios.org/developerinfo/ex ... mand_id=42

Though fail-tolerant locking is, in general, a non-trivial problem to solve :)

Re: is it possible to serialize some checks?

Posted: Mon Nov 13, 2017 1:54 pm
by dwhitfield
mcapra wrote:I don't know of anything in Nagios Core that would support this.
On the note above, it may be possible to get something like this in Core 5. You can submit a feature request at https://github.com/NagiosEnterprises/na ... issues/new . Make sure you like to this thread so that the developers have a full picture of what you are trying to do.