I've been learning about passive check and I have set one up and seems to be working properly apart from the email notification.
This is what the service looks like, I've set the notification interval for 2 hours. Even when I manually check the service to ping, to clear the error I never get a notification email
Code: Select all
define service {
name SNMP_TRAP
service_description SNMP_TRAP
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized
process_perf_data 0
obsess_over_service 0 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
check_command check-host-alive ; This will be used to reset the service to "OK"
is_volatile 1
check_period 24x7
max_check_attempts 1
normal_check_interval 1
retry_check_interval 1
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
contact_groups test ; Modify this to match your Nagios contact group definitions
register 0
}
Thank you
Code: Select all
[1551749484] PASSIVE SERVICE CHECK: NDC-SW-LSD;TRAP;0;PING OK - Packet loss = 0%, RTA = 0.88 ms
[1551749484] SERVICE ALERT: NDC-SW-LSD;TRAP;CRITICAL;HARD;1;Notification of a configuration management event as commandLine running networkTftp
[1551749484] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;192.168.130.158;TRAP;2;Notification of a configuration management event as commandLine startup networkTftp
[1551749484] PASSIVE SERVICE CHECK: NDC-SW-LSD;TRAP;2;Notification of a configuration management event as commandLine running networkTftp
[1551749484] SERVICE ALERT: NDC-SW-LSD;TRAP;CRITICAL;HARD;1;Notification of a configuration management event as commandLine startup networkTftp
[1551750036] EXTERNAL COMMAND: DISABLE_SVC_FLAP_DETECTION;NDC-SW-LSD;TRAP
[1551750036] SERVICE FLAPPING ALERT: NDC-SW-LSD;TRAP;DISABLED; Flap detection has been disabled
[1551750074] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;192.168.130.158;TRAP;2;Notification of a configuration management event as commandLine running startup
[1551750074] PASSIVE SERVICE CHECK: NDC-SW-LSD;TRAP;2;Notification of a configuration management event as commandLine startup networkTftp
[1551750074] SERVICE NOTIFICATION: nagiosadmin;NDC-SW-LSD;TRAP;CRITICAL;notify-service-by-email;Notification of a configuration management event as commandLine running startup
[1551750074] SERVICE ALERT: NDC-SW-LSD;TRAP;CRITICAL;HARD;1;Notification of a configuration management event as commandLine running startup
[1551750094] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;192.168.130.158;TRAP;2;Notification of a configuration management event as commandLine running startup
[1551750094] PASSIVE SERVICE CHECK: NDC-SW-LSD;TRAP;2;Notification of a configuration management event as commandLine running startup
[1551750094] SERVICE NOTIFICATION: nagiosadmin;NDC-SW-LSD;TRAP;CRITICAL;notify-service-by-email;Notification of a configuration management event as commandLine running startup
[1551750094] SERVICE ALERT: NDC-SW-LSD;TRAP;CRITICAL;HARD;1;Notification of a configuration management event as commandLine running startup
[1551750117] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;NDC-SW-LSD;TRAP;1551750116
[1551750121] SERVICE NOTIFICATION: nagiosadmin;NDC-SW-LSD;TRAP;OK;notify-service-by-email;PING OK - Packet loss = 0%, RTA = 7.42 ms
[1551750121] SERVICE ALERT: NDC-SW-LSD;TRAP;OK;HARD;1;PING OK - Packet loss = 0%, RTA = 7.42 ms