Thursday, February 11, 2010

Passive checks with Nagios

Today, while I was trying to set up Nagios on my local box at work when Nagios refused to start due to bad configuration error.

Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.

It took some to time to realize that a "check_command" line has to be defined even for passive check.

define service {
    use                        local-service
    service_description        passive_service
    check_command              check_dummy!2
    active_checks_enabled      0
    passive_checks_enabled     1

The best explanation is from the 2.0 docs located at:

What Happens When A Service Check Result Becomes "Stale"

If the check results of a service are found to be "stale" (as described above), Nagios will force an active check of the service by executing the command specified by the check_command option in the service definition. It is important to note that an active service check which is being forced because the service was detected as being "stale" gets executed even if active service checks are disabled on a program-wide or service-specific basis.

In the above example, if the service becomes "stale", the check_dummy command would simply reply with a critical(2) return code.

No comments:

Post a Comment