...
Shinken Enterprise permet de détecter, en option, les hôtes et services en état flapping. Celui-ci arrive quand l'état de l'élément change trop souvent, envoyant beaucoup trop de notifications de d'alertes /et de reprises successives. Le flapping peut être caractéristique de problèmes de configuration (i.e. seuils trop bas par exemple), ou de vrais problèmes de réseau.réseaux.
Quand un élément passe en flapping, toutes ses notifications sont interrompues afin de ne pas submerger les utilisateurs, jusqu'à ce qu'il revienne dans un état stable (qu'il soit OK/UP ou DOWN/CRITICAL).
Comment ça fonctionne
A chaque fois que Shinken Enterprise vérifie le statut d'un hôte ou d'un servicecheck, il commence par vérifier si l'élément a commencé ou vient d'arrêter d'être en Flapping. Il le fait de la façon suivante :.
- Stockage des résultats des 21 derniers checks
- Analyse de l'historique des résultats et détermination du moment où l'état à changéde quand les changements d'états et de transitions arrivent
- Détermination du pourcentage de changement d'état
- Comparaison de ce taux avec les valeurs définies comme seuils seuils haut/bas de flapping pour entrer/sortir de l'état flapping.
Un élément est vu comme ayant démarré le flapping quand son pourcentage de changement d'états dépasse pour la première fois le seuil haut de flapping.
Un élément est vu comme ayant arrété le flapping quand son pourcentage descend en dessous du seuil bas de flapping. (en assumant qu'il était précédemment en train de faire du flapping)
Exemple
Voyons la mécanique plus en détail avec un check.
...
Les résultats de la vérification de l'historique sont examinées afin de déterminer où les changements d'état / transitions se produisent. Les changements d'état se produisent quand un état archivé est différent de l'état archivé qui le précède immédiatement chronologiquement . Comme nous conservons les résultats des 21 derniers contrôles de service dans le réseau, il ya y a une possibilité d'avoir au moins 20 changements d'état. La valeur 20 peut être modifiée dans le fichier de configuration principal .
Dans cet exemple, il y a 7 changements d'état , indiqués par les flèches bleues dans l'image ci-dessus.
La logique de détection de Flapping utilise le changement d'état pour déterminer le pourcentage global du checkde changement de l'élement. C'est une mesure de volatilité du servicecheck.
- Les
...
- checks qui ne changent jamais d'état sont à 0%,
- alors que ceux qui changent à chaque
...
- vérification seront à 100%.
Note: Dans l'algorithme de calcul, un poids plus important sera donné aux derniers résultats par rapport aux plus anciens. En règle générale, on fait en sorte que les derniers résultats pèsent pour 50% du total . SEn utilisant l'image ci-dessus, faisons un calcul de pourcentage. Dans cet exemple, il y a 7 changements d'état sur les 21 derniers checks. (à t3, t4, t5, t9, t12, t16, et t19). Sans pondération, le pourcentage moyen serait de 35%:
(7 changements observés/20 possibles ) * 100 = 35 %
Since the flap detection logic will give newer state changes a higher rate than older state changes, the actual calculated percentage state change will be slightly less than 35% in this example. Let's say that the weighted percentage of state change turned out to be 31%...
The calculated percentage state change for the service (31%) will then be compared against flapping thresholds to see what should happen:
- If the service was not previously flapping and 31% is equal to or greater than the high flap threshold, Shinken Enterprise considers the service to have just started flapping.
- If the service was previously flapping and 31% is less than the low flap threshold, Shinken Enterprise considers the service to have just stopped flapping.
If neither of those two conditions are met, the flap detection logic won't do anything else with the service, since it is either not currently flapping or it is still flapping.
Flap Detection for Checks
Shinken Enterprise checks to see if a service is flapping whenever the service is checked (either actively or passively).
The flap detection logic for services works as described in the example above.
Flap Detection for Hosts
Host flap detection works in a similar way to service flap detection, with one important difference: Shinken Enterprise will attempt to check to see if a host is flapping whenever:
* The host is checked (actively or passively)
* Sometimes when a service associated with that host is checked. More specifically, when at least x amount of time has passed since the flap detection was last performed, where x is equal to the average check interval of all services associated with the host.
Why is this done? With services we know that the minimum amount of time between consecutive flap detection routines is going to be equal to the service check interval. However, you might not be monitoring hosts on a regular basis, so there might not be a host check interval that can be used in the flap detection logic. Also, it makes sense that checking a service should count towards the detection of host flapping. Services are attributes of or things associated with host after all... In any case, that's the best method I could come up with for determining how often flap detection could be performed on a host, so there you have it.
Flap Detection Thresholds
Shinken Enterprise uses several variables to determine the percentage state change thresholds is uses for flap detection. For both hosts and services, there are global high and low thresholds and host- or service-specific thresholds that you can configure. Shinken Enterprise will use the global thresholds for flap detection if you to not specify host- or service- specific thresholds.
This screenshot shows the global and host- or check-specific variables that control the various thresholds used in flap detection.
States Used For Flap Detection
...
You can exclude certain host or service states from use in flap detection logic by using the "flap_detection_options" directive in your host or service definitions. This directive allows you to specify what host or service states (i.e. "UP, "DOWN", "OK, "CRITICAL") you want to use for flap detection. If you don't use this directive, all host or service states are used in flap detection.
Flap Handling
...
Par exemple, prenons le cas d'un pourcentage calculé de 31%. Il va être comparé aux seuils définis :
- si l'élément n'était pas en état flapping auparavant et que le pourcentage calculé est supérieur au seuil haut (high), Shinken Enterprise considère que l'élément vient juste de passer en flapping.
- si l'élément était précédemment en flapping et que le pourcentage calculé est inférieur au seuil bas (low), Shinken Enterprise considère que l'élément vient juste de s'arrêter d'être en flapping.
Seuils de détection du flapping
Shinken Enterprise utilise plusieurs variables afin de déterminer le seuil de pourcentage définissant l'état de flapping.
Ces seuils hauts et bas que vous pouvez configurer, sont définis au niveau spécifique d'un hôte et d'un check.
Cet impression écran montre les variables qui contrôlent les seuils utilisées dans la détection du flap pour un hôte :
Traitement du flapping
Lorsqu'un élément est fraîchement détecté comme étant en flapping, Shinken Enterprise va:
- logguer un message indiquant que l'élément est en flapping .
- envoyer une notification d'alerte de début de flapping aux contacts appropriés.
- supprimer toutes les autres notifications sur l'élément
Lorsqu'un élément cesse d'être en flapping, Shinken Enterprise va:
- logguer un message indiquant que l'élément n'est plus en flapping.
- envoyer une notification de fin de flapping aux contacts appropriés
- reprendre les notifications pour cet élément
Activer la détection de flapping
Afin de l'activer dans Shinken Enterprise, vous devrez:
- paramétrer enable_flap_detection à 1 dans le fichier de configuration central.
- paramétrer sur "True" le paramètre "Flap Detection Enabled" dans la définition de l'hôte ou du check.
Changer les seuils de détection du flapping
Afin de change les seuils d'entrée/sortie de l'état flapping dans Shinken Enterprise , vous devrez:
- Changer le paramètre Low Flap % option à la valeur désirée. La valeur par défaut est de 25%
- Set the High Flap % option à la valeur désirée. La valeur par défaut est de 50%
- Log a message indicating that the service or host is flapping.
- Add a non-persistent comment to the host or service indicating that it is flapping.
- Send a "flapping start" notification for the host or service to appropriate contacts.
- Suppress other notifications for the service or host.
When a service or host stops flapping, Shinken Enterprise will:
- Log a message indicating that the service or host has stopped flapping.
- Delete the comment that was originally added to the service or host when it started flapping.
- Send a "flapping stop" notification for the host or check to appropriate contacts.
- Remove the block on notifications for the service or host (notifications will still be bound to the normal :ref:`notification logic <thebasics/notifications>`).
Enabling Flap Detection
...
- Set enable_flap_detection directive is set to 1 in the main configuration file
...
If you want to disable flap detection on a global basis, set the enable_flap_detection directive to 0.
If you would like to disable flap detection for just a few hosts or checks, use the Flap Detection Enabled directive in the host and/or checks definitions to do so.


