When a service is defined as volatile, each time nagios found that the service is in hard non-OK state, nagios will:
In other words, there is no need for hard state-change for these actions to fire.
With snmptt, log and report SNMP Traps received.
define service {
...
service_description snmp-traps
is_volatile 1
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
normal_check_interval 1
# set these only if the host has no other service checks:
#freshness_threshold 86400
#check_command check-host-alive
...
}
A door sentry device will report CRITICAL status to nagios whenever it is opened, then nagios will run the trap-the-intruder command to capture the thief. As the service is volatile, every thief will be captured.
define service {
...
service_description door-sentry
is_volatile 1
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
event_handler trap-the-intruder
...
}