Passive Check Email Notification

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
Pikmin
Posts: 80
Joined: Tue Feb 17, 2015 5:32 pm

Passive Check Email Notification

Post by Pikmin »

Hey everyone,

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
}
However soon as I disable flapping, I get emails without any problems
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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Passive Check Email Notification

Post by scottwilkerson »

With these you likely want to disable flapping, flapping enabled will suppress notification if the host/service is rapidly changing states

More on flapping
https://assets.nagios.com/downloads/nag ... pping.html
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Pikmin
Posts: 80
Joined: Tue Feb 17, 2015 5:32 pm

Re: Passive Check Email Notification

Post by Pikmin »

Thanks Scott, will do
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Passive Check Email Notification

Post by scottwilkerson »

Pikmin wrote:Thanks Scott, will do
Let us know if we can be of further assistance
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Pikmin
Posts: 80
Joined: Tue Feb 17, 2015 5:32 pm

Re: Passive Check Email Notification

Post by Pikmin »

I do have one more query, but not sure if it's snmptt or submit_check_result, looks like it might be the former

the smptt conf file

Code: Select all

EVENT cErrDisableInterfaceEvent .1.3.6.1.4.1.9.9.548.0.1.1 "Status Events" Normal
FORMAT The cErrDisableInterfaceEvent is generated when an interface $*
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r ERR_DISABLE 2 "The cErrDisableInterfaceEvent is generated when an interface $*"
SDESC
The cErrDisableInterfaceEvent is generated when an interface
or {interface, vlan} is error-disabled by the feature
specified in cErrDisableIfStatusCause.
cErrDisableInterfaceEvent is deprecated and replaced by
cErrDisableInterfaceEventRev1.
Variables:
  1: cErrDisableIfStatusCause
EDESC
snmptt status

Code: Select all

Mar 06 14:13:55 ndnagios snmptt[18010]: .1.3.6.1.4.1.9.9.548.0.1.1 Normal "Status Events" 192.168.130.159 - The cErrDisableInterfaceEvent is generated when an interface bpduGuard
nagios.log

Code: Select all

[1551844055] SERVICE ALERT: NDC-SW-LSD-Access1;ERR_DISABLE;CRITICAL;HARD;1;The cErrDisableInterfaceEvent is generated when an interface bpduGuard
What is the character limit for submit_nagios_check ? Is there a way to have the full description from the conf?

Appreciate your help
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Passive Check Email Notification

Post by scottwilkerson »

Only the first line is added to the nagios output, currently it looks like this is broken up into multiple lines.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Pikmin
Posts: 80
Joined: Tue Feb 17, 2015 5:32 pm

Re: Passive Check Email Notification

Post by Pikmin »

Thanks for that, I was hoping there would be more info, like which specific port is in err disable but I guess I need to check the snmptt documentation and whether that's at all possible, I could be confusing the trap info with syslog info
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Passive Check Email Notification

Post by scottwilkerson »

Pikmin wrote:Thanks for that, I was hoping there would be more info, like which specific port is in err disable but I guess I need to check the snmptt documentation and whether that's at all possible, I could be confusing the trap info with syslog info
Yes, this also depends on what the Trap sends
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Pikmin
Posts: 80
Joined: Tue Feb 17, 2015 5:32 pm

Re: Passive Check Email Notification

Post by Pikmin »

Thanks for your help
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Passive Check Email Notification

Post by benjaminsmith »

Hi @Pikum,
Thanks for your help
May we close this topic?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked