Are Nagios Active Checks Synchronous or Async ?

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
vlakshman
Posts: 27
Joined: Tue Aug 21, 2018 11:03 am

Are Nagios Active Checks Synchronous or Async ?

Post 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).
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Are Nagios Active Checks Synchronous or Async ?

Post 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.
Former Nagios employee
https://www.mcapra.com/
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Are Nagios Active Checks Synchronous or Async ?

Post by ssax »

mcapra is correct, let us know if we can clarify anything for you.
Locked