See Also: Active Checks, Service Checks, Host Checks
In most cases you’ll use Naemon to monitor your hosts and services using regularly scheduled active checks. Active checks can be used to “poll” a device or service for status information every so often. Naemon also supports a way to monitor hosts and services passively instead of actively. They key features of passive checks are as follows:
The major difference between active and passive checks is that active checks are initiated and performed by Naemon, while passive checks are performed by external applications.
Passive checks are useful for monitoring services that are:
Examples of asynchronous services that lend themselves to being monitored passively include SNMP traps and security alerts. You never know how many (if any) traps or alerts you’ll receive in a given time frame, so it’s not feasible to just monitor their status every few minutes.
Passive checks are also used when configuring distributed or redundant monitoring installations.
Here’s how passive checks work in more detail…
The processing of active and passive check results is essentially identical. This allows for seamless integration of status information from external applications with Naemon.
In order to enable passive checks in Naemon, you’ll need to do the following:
If you want to disable processing of passive checks on a global basis, set the accept_passive_service_checks directive to 0.
If you would like to disable passive checks for just a few hosts or services, use the passive_checks_enabled directive in the host and/or service definitions to do so.
External applications can submit passive service check results to Naemon by writing a PROCESS_SERVICE_CHECK_RESULT external command to the external command file.
The format of the command is as follows:
[<timestamp>] PROCESS_SERVICE_CHECK_RESULT;<host_name>;<svc_description>;<return_code>;<plugin_output>
where…
External applications can submit passive host check results to Naemon by writing a PROCESS_HOST_CHECK_RESULT external command to the external command file.
The format of the command is as follows:
[<timestamp>] PROCESS_HOST_CHECK_RESULT;<host_name>;<host_status>;<plugin_output>
where…
Unlike with active host checks, Naemon does not (by default) attempt to determine whether or host is DOWN or UNREACHABLE with passive checks. Rather, Naemon takes the passive check result to be the actual state the host is in and doesn’t try to determine the host’s actual state using the reachability logic. This can cause problems if you are submitting passive checks from a remote host or you have a distributed monitoring setup where the parent/child host relationships are different.
You can tell Naemon to translate DOWN/UNREACHABLE passive check result states to their "proper" state by using the translate_passive_host_checks variable. More information on how this works can be found here.
If an application that resides on the same host as Naemon is sending passive host or service check results, it can simply write the results directly to the external command file as outlined above. However, applications on remote hosts can’t do this so easily.
In order to allow remote hosts to send passive check results to the monitoring host, I’ve developed the NSCA addon. The NSCA addon consists of a daemon that runs on the Naemon hosts and a client that is executed from remote hosts. The daemon will listen for connections from remote clients, perform some basic validation on the results being submitted, and then write the check results directly into the external command file (as described above). More information on the NSCA addon can be found here.