Nagios notification escalations made easy

Since someone asked in the nagios users mailing list for an help to understand how notification escalations work in Nagios, I wrote an easy and short workflow to explain the logic underneath.

Notification escalations are a means to ensure that someone will ne notified, eventually. If a contact doesn’t acknowledge a problem, we can escalate the nofications to someone else, changing the way we deliver the messages if we think it’s a good strategy.

In this post we won’t discuss of the syntax or the options regarding the escalations, we will have a look at the logic of the escalations, at how they take place and how they work.

Here the workflow for check/notification/escalation is the following:

  1. The service/host is checked in OK state with the check_interval timing;
  2. As the service/host goes into a NON OK state, but didn’t reach the max_check_attempts, the service enters a SOFT NON OK state and the next check is scheduled with the retry_interval timing;
  3. As the service/host in NON OK state reaches the max_check_attempts value, the service enters an HARD NON OK STATE and the next service/host check is scheduled with the check_interval timing;
  4. Now, if you set first_notification_delay, this can alter the timing for the first notification to be sent (0 means notifications to be sent immediately);
  5. If you didn’t set the first_notification_delay, the first notification is immediately sent and the following will be scheduled with the notification_interval timing (0 means only the first notification will be sent, the other will not be sent);

Now, let’s make a practical example:

define serviceescalation{
host_name               webserver
service_description     HTTP
first_notification      3
last_notification       5
notification_interval   45
contact_groups          ITOps_Oncall,managers
}
define serviceescalation{
host_name               webserver
service_description     HTTP
first_notification      6
last_notification       0
notification_interval   60
contact_groups	  ITOps_Oncall,managers,everyone
}

What happens? Here we go:

  1. In this escalation, at the third notification (with the notification_interval taking place), the notification interval changes to 45 minutes, so the first notification will be sent after the max_check_attempts value will be reached (assuming you didn’t put any delay), then the second after 10 time units, usually 10 minutes, the third 10 mins after the second, the fourth 45 mins after the third, the fifth 45 mins after the fourth, the sixth 45 mins after the fifth.
  2. From the sixth notification, the new escalation comes into play. The seventh notification will be sent after 60 minutes, and all the other notifications will be sent 60 mins after each other. Keep in mind that having used 0 as the last_notification value, you escalation will never end till your check will return an OK status.

Rilasciato check_bandwidth_snmp v.0.1

Oggi ho rilasciato il mio script per controllare con Nagios la banda di un qualsiasi apparato di rete che supporti SNMP v3. Solo dopo 1 anno dalla stesura dello script eh…

Ho dovuto abbellirlo e modificarlo, per renderlo “guardabile”. In questa operazione di revisione potrebbe essersi infilato qualche noioso baco. Ho provato il nuovo script e sembra funzionare, ma se trovaste degli errori, fatemelo sapere e vedremo cosa fare.

Ci sono, anche a prima vista, dei miglioramenti da fare, come per esempio un meccanismo di login più flessibile o un ciclo per il controllo delle variabili, ma se avessi atteso queste ulteriori modifiche, non avrei più reso disponibile lo script. Mi conosco. Casomai, le migliorie potranno essere oggetto di un secondo rilascio, se mai…

Lo trovate qui

MonitoringExchange

A gentile richiesta, apre il forum su Nagios

Come si diceva, a gentile richiesta.

In realtà 1 me lo ha chiesto lol, ho aperto un forum in italiano per fare due chiacchiere su Nagios.

Nel caso vi interessi, fate un salto a questa url.

P.S.

Voi iniziate a chiacchierare, che io inizio a scrivere la guida. Acc…quante volte l’ho promesso? Giuro che lo faccio!

Ethan Galstad (fatherofnagios) is now following your updates on Twitter.

Father of Nagios

Hi, Giorgio Zarrelli.

Ethan Galstad (fatherofnagios) is now following your updates on Twitter.

A little information about Ethan Galstad:

109 followers
36 updates

following 181 people

You may follow Ethan Galstad as well by clicking on the “follow” button on their profile.You may also block Ethan Galstad if you don’t want them to follow you.

Che sia lui o un plugin di Nagios???? Lol. La foto sopra l’ho scattata durante la pausa pranzo all’evento Nagios presso il TIS di Bolzano poco dopo avergli detto “Eh, ste ndoutils non è che funzionino proprio bene…l’utilizzo di MySQL non è proprio ottimizzato…” Come risultare simpatico e indigesto 🙂 Comunque, simpatico, non c’è che dire, pure paziente. Ah, per la cronaca, Ethan ha ammesso che le ndoutils richiedono ancora del lavoro…rotfl!