Page 1 of 1

Are Nagios Active Checks Synchronous or Async ?

Posted: Tue Dec 18, 2018 1:06 pm
by vlakshman
Guys,

I know what are active checks in Nagios. I was wondering if active checks are synchronous or async?
For example: Lets say, I have scheduled a service every 30 sec but the corresponding plugin takes say 40 sec to execute.
In this case, will Nagios span a new thread for each Active Check (meaning async) or will it wait for response of first check before making another request (sync).

Re: Are Nagios Active Checks Synchronous or Async ?

Posted: Tue Dec 18, 2018 3:35 pm
by mcapra
For a single instance of Nagios Core, a given check gets assigned to a check worker:
https://assets.nagios.com/downloads/nag ... gmain.html
Check Workers

Format: check_workers=<#>
Example: check_workers=10
This setting specifies how many worker process should be started when Nagios Core starts. Worker processes are used to perform host and service checks. If the number of workers is not specified, a default number of workers is determined based on the number of CPU cores on the system (1.5 workers per core). If not specified, there is always a minimum of 4 workers.
I believe plugin execution is a blocking task within the context of a particular worker, but yes "multiple threads" exist to handle check execution.

You can further distribute/federate this work via platforms like Mod-Gearman without the need of additional check workers or Nagios Core instances.

Re: Are Nagios Active Checks Synchronous or Async ?

Posted: Tue Dec 18, 2018 5:51 pm
by ssax
mcapra is correct, let us know if we can clarify anything for you.