Page 1 of 1

Disable flapping on service

Posted: Tue Nov 28, 2017 12:57 pm
by jkinning
I have several services that are monitoring a MSSQL database using a Powershell script. Everything works great except I have noticed some notifications don't get dispatched because of flapping being enabled. I have set the Flapping Enabled to Off but I still am seeing this on the service and no notification gets sent out.

Here is the message and settings I am currently using. This check is monitoring logs so flapping is not needed.

Re: Disable flapping on service

Posted: Tue Nov 28, 2017 3:17 pm
by kyang
Everything works great except I have noticed some notifications don't get dispatched because of flapping being enabled. I have set the Flapping Enabled to Off but I still am seeing this on the service and no notification gets sent out.
I just have to double check. Whether you set flapping to on or off, you are not receiving notifications?
This check is monitoring logs so flapping is not needed
But overall, you would still like to get notifications? In which it is not sending notifications? Is this right, or did I misunderstand something?

Have you tried using skip?

What version of Nagios XI do you have?

Re: Disable flapping on service

Posted: Tue Nov 28, 2017 3:51 pm
by jkinning
Sorry, Nagios XI 5.4.11 is what I am running.

I have not tried skip but will give that a try. I do want notification but Nagios is seeing the service flapping and doesn't send out the notifications. I want to disable that feature so notifications get sent for the critical state of the service.

I have flapping enable set to off and do not receive the notifications due to Nagios seeing the service flapping so it suppresses them.

Re: Disable flapping on service

Posted: Tue Nov 28, 2017 4:33 pm
by kyang
Let me know how skip works, and I see what you mean.

What are your alert settings?

Here's something I found on the Nagios Core Github.

https://github.com/NagiosEnterprises/na ... /issues/91

Re: Disable flapping on service

Posted: Wed Nov 29, 2017 7:57 am
by jkinning
I don't have flapping enabled in my notification. Will that still send out notification when the service gets marked as flapping by Nagios XI?

Re: Disable flapping on service

Posted: Wed Nov 29, 2017 10:11 am
by lmiltchev
Let's review the flapping options under the Check/Alert Settings tabs, and see what they really mean.

Check Settings tab
Service - flap detection enabled

This directive is used to determine whether or not flap detection is enabled for this service. More information on flap detection can be found in the nagios documentation. Values: 0 = disable service flap detection, 1 = enable service flap detection.

Parameter name: flap_detection_enabled
For more info, see our official Nagios Core documentation on the topic here:
https://assets.nagios.com/downloads/nag ... pping.html

You were correct to disable flap detection under the Check Settings tab on the local level (your first screenshot). What we need to find out is whether the service is still in a "flapping state" or it recovered. Are you still seeing "Service is flapping between states" under the "Service Status Detail" page (Overview tab)? What is the value of the "is_flapping" directive for this service in the status.dat file? What is the "flap_detection_enabled" value? Does nagios "think" the flap detection is still enabled, even though you disabled it in the GUI? What is the value of the "flap_detection_enabled" for this service in the objects.cache?

Note: As far as the "skip" option, it only means that you are not defining the option directly (on the service level), but you are inheriting it from a template.

Alert Settings tab
Service - notification options

This directive is used to determine when notifications for the service should be sent out. Valid options are a combination of one or more of the following:

w = send notifications on a WARNING state,
u = send notifications on an UNKNOWN state,
c = send notifications on a CRITICAL state,
r = send notifications on recoveries (OK state),
f = send notifications when the service starts and stops flapping, and
s = send notifications when scheduled downtime starts and ends.

If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states.

Example: If you specify w,r in this field, notifications will only be sent out when the service goes into a WARNING state and when it recovers from a WARNING state.
In your last screenshot we see that you have selected only "Critical" under the "Notification options". This means that notifications will be sent out ONLY on a CRITICAL state. You can deselect the "Critical" if you wish to receive notifications about all states, or select "Flapping" (in addition to "Critical") if you wish to receive notifications about Critial and Flapping states.

Re: Disable flapping on service

Posted: Wed Nov 29, 2017 10:54 am
by jkinning
You were correct to disable flap detection under the Check Settings tab on the local level (your first screenshot). What we need to find out is whether the service is still in a "flapping state" or it recovered. Are you still seeing "Service is flapping between states" under the "Service Status Detail" page (Overview tab)? What is the value of the "is_flapping" directive for this service in the status.dat file? What is the "flap_detection_enabled" value? Does nagios "think" the flap detection is still enabled, even though you disabled it in the GUI? What is the value of the "flap_detection_enabled" for this service in the objects.cache?
Are you still seeing "Service is flapping between states" under the "Service Status Detail" page (Overview tab)?
Yes
What is the value of the "is_flapping" directive for this service in the status.dat file?
Where do I find this file?

Here it the config file for one of the services. I have about 20 of these but all are identical minus the check command syntax.
define service {
host_name DGTLMON1P
service_description Digital Policy Service
check_command check_nrpe_digital_db_monitor!"5"!"5"!"5"!"DigitalLogNagios"!"password"!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
flap_detection_enabled 0
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options c,
contact_groups digital_monitoring_database_monitoring
register 1
}

Re: Disable flapping on service

Posted: Wed Nov 29, 2017 11:22 am
by lmiltchev
The status.dat and objects.cache files are located in the "/usr/local/nagios/var/" directory, unless you changed that. For example, if you are utilizing a ramdisk, they could be in the "/var/nagiosramdisk/" directory.

As long as the service is still flapping, notifications won't go out. You have two options as I see it:

1. Wait until the service recover from the flapping state "on its own"

2. Force the recovery manually.
- Stop nagios service

Code: Select all

service nagios stop
- Open the "/usr/local/nagios/var/retention.dat" in a text editor, find the service in question, and change this:

Code: Select all

is_flapping=1
to this:

Code: Select all

is_flapping=0
Save and exit.
- Start nagios service

Code: Select all

service nagios start
This should clear the flapping state.

FYI: The status.dat file is uses to store the current status, comment, and downtime information. It is deleted every time Nagios stops and recreated when it starts. You could check the flapping status of your service before performing step 2 (stopping nagios service), and after you are done (after starting nagios service). The state should change from "is_flapping=1" to "is_flapping=0".

Re: Disable flapping on service

Posted: Thu Nov 30, 2017 8:25 am
by jkinning
So far things are looking better. I just got word back from the Business Unit and that is what they reported.

You can close this for now and if it reappears I'll open up a new thread.

Re: Disable flapping on service

Posted: Thu Nov 30, 2017 10:07 am
by kyang
Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!