SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Open Source Monitoring Conference 2009 © Wolfgang Barth 1
Das Nagios-
Benachrichtigungssystem
Grundlagen, Eskalationen,
Dependencies, Workflow
Nürnberg, 2009-10-29
Open Source Monitoring Conference 2009 © Wolfgang Barth 2
Agenda
● Grundlagen
● Eskalationen, Dependencies
● Einflussfaktoren: Flapping, Downtime,
Acknowledgements
● Custom Notifications
Open Source Monitoring Conference 2009 © Wolfgang Barth 3
Benachrichtigungen
● Direkte Information von
Verantwortlichen (push statt pull wie
bei der Weboberfläche
● Auslöser für eine Benachrichtigung:
– Ein Hard State wechselt in einen anderen
Hard State
– Ein Hard State mit Fehlerzustand besteht
weiterhin
> notification_period
> is_volatile
Open Source Monitoring Conference 2009 © Wolfgang Barth 4
Einflussmöglichkeiten
statisch:
● Konfiguration
– System
– Host, Service
– Kontakt
● Eskalationen
dynamisch:
● Acknowledgements
● Downtime
● Flapping
● Dependencies
Open Source Monitoring Conference 2009 © Wolfgang Barth 5
Konfigurations-
möglichkeiten
Host/
Service
System
Kontakt
Command
enable_notfications=1
notfications_enabled=1
Filter (was, wann, wer, wie oft)
host/service_notfications_enabled=1
Filter (was, wann, wie)
E-Mail, SMS, Ampel, ...
... alles, was sich mit einem Programm
ansteuern lässt ...
tactical overview
Open Source Monitoring Conference 2009 © Wolfgang Barth 6
Notifications: Parameter
Host Service
notification_period
notification_options
notification_interval
first_notification_delay
Contact/
-group
host_notification_period
host_notification_options
service_notification_period
service_notification_options
Command
externes Programm, z.B. E-
Mail, SMS, Webservice, ...
Open Source Monitoring Conference 2009 © Wolfgang Barth 7
Notifications: Was
Host Service
notification_period
notification_options
notification_interval
first_notification_delay
Contact/
-group
host_notification_period
host_notification_options
service_notification_period
service_notification_options
Command
externes Programm, z.B. E-
Mail, SMS, Webservice, ...
Open Source Monitoring Conference 2009 © Wolfgang Barth 8
notification_options
Host:
– d: down
– u: unreachable
– r: recovery
– f: flapping
– s: scheduled
downtime
– n: “none“
– a: „all“ (*)
Service:
– w: warning
– u: unknown
– c: critical
– r: recovery
– f: flapping
– s: scheduled
downtime
– n: „none“
– a: „all“ (*)
(*) undokumentiert
Open Source Monitoring Conference 2009 © Wolfgang Barth 9
Notifications: Wann
Host Service
notification_period
notification_options
notification_interval
first_notification_delay
Contact/
-group
host_notification_period
host_notification_options
service_notification_period
service_notification_options
Command
externes Programm, z.B. E-
Mail, SMS, Webservice, ...
Open Source Monitoring Conference 2009 © Wolfgang Barth 10
n*_period, n*_interval
● notification_period:
– timeperiod-Objekt
– Zeitraum, in dem die Benachrichtigungen
generiert (Host/Service) oder gefiltert
(Kontakt) werden
● notification_interval:
– Wiederholungsintervall
● delay_first_notification:
– Verzögert die erste Nachricht
Open Source Monitoring Conference 2009 © Wolfgang Barth 11
Timing-Beispiel (I)
define service { ...
check_interval = 15 ; (min)
max_check_attempts = 1 ;
notification_period = 9x5 ; (8h-17h)
notification_interval = 120 ; (min)
... }
7h 8h 9h 10h
Fehler 1. Nachricht 2. Nachricht
7h30
Open Source Monitoring Conference 2009 © Wolfgang Barth 12
Timing-Beispiel (II)
define service { ...
notification_period = 7x24 ; (immer)
... }
define contact {
notification_period = 9x5 ; (8h-17h)
}
7h 8h 9h 10h
Fehler 1. Nachricht 2. Nachricht
7h30 9h30
Open Source Monitoring Conference 2009 © Wolfgang Barth 13
Timing-Beispiel (III)
define service { ...
notification_period = 7x24 ; (immer)
first_notification_delay = 15 ; (min)
... }
define contact {
notification_period = 9x5 ; (8h-17h)
}
7h 8h 9h 10h
Fehler 1. Nachricht
7h30
2. Nachricht
9h45
Open Source Monitoring Conference 2009 © Wolfgang Barth 14
Notifications: Wer
Host Service
contactgroups
contacts
Contact/
-group
host_notification_period
host_notification_options
service_notification_period
service_notification_options
Command
externes Programm, z.B. E-
Mail, SMS, Webservice, ...
Open Source Monitoring Conference 2009 © Wolfgang Barth 15
Generiert/gefiltert
Host Service
Contact/
-group
Command
Nachricht ist generiert
Nachricht ist gefiltert
Open Source Monitoring Conference 2009 © Wolfgang Barth 16
is_volatile=1
● nur bei Services vorhanden
● Benachrichtigung bei jedem „Non-OK
Hard State“ Ergebnis
● notification_interval = deaktiviert
● sinnvoll bei Services, die sich selbst
zurücksetzen:
– Counter in aktiven Netzwerkkomponenten
– Logfile-Überwachung
Open Source Monitoring Conference 2009 © Wolfgang Barth 17
Notifications: Wie
Host Service
Contact/
-group
host_notification_commands service_notification_commands
Command
externes Programm, z.B. E-
Mail, SMS, Webservice, ...
Open Source Monitoring Conference 2009 © Wolfgang Barth 18
*_notification_commands (I)
● wie jedes andere command-Objekt:
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" 
"***** Nagios *****nn
Notification Type: $NOTIFICATIONTYPE$nn
Service: $SERVICEDESC$n
Host: $HOSTNAME$n
Address: $HOSTADDRESS$n
State: $SERVICESTATE$nn
Date/Time: $LONGDATETIME$n
Duration: $SERVICEDURATION$nn
Additional Info:nn
$SERVICEOUTPUT$" | 
/usr/bin/mail -s "$NOTIFICATIONTYPE$ alert - 
$HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$
}
Open Source Monitoring Conference 2009 © Wolfgang Barth 19
*_notification_commands (II)
● Alternative: externes Skript, das
Environment-Variablen verwendet:
$HOSTNAME$ -> $NAGIOS_HOSTNAME
● wichtig:
enable_environment_macros = 1
Open Source Monitoring Conference 2009 © Wolfgang Barth 20
Eskalationen
&
Dependencies
Open Source Monitoring Conference 2009 © Wolfgang Barth 21
Eskalationen (I)
● Wann wird welcher Kontakt informiert?
➔ „wann“ = Anzahl der Benachrichtigungen
1 2 3 4 5 6 7 8 9 10 11
admins
admins, secondlevel
GF
..3 4..8 7..10
Anzahl der Nachrichten
Open Source Monitoring Conference 2009 © Wolfgang Barth 22
Eskalationen (II)
serviceescalation {
host_name web01
service_description HTTP
first_notification 4
last_notification 8
notification_interval 60
contact_groups admins,secondlevel
escalation_period 7x24
escalation_options c,r ; w,u
...}
Überlappungen
Open Source Monitoring Conference 2009 © Wolfgang Barth 23
Service-Dependencies (I)
web01
Disks
web01
Users
web01
Load
web01
NRPE
Nagios
host_name
service_description
dependent_host_name
dependent_service_desc*
Open Source Monitoring Conference 2009 © Wolfgang Barth 24
Service-Dependencies (II)
service_dependency {
host_name web01 ;master
service_description NRPE ;master
dependent_host_name web01
dependent_service_description Disks
notification_failure_criteria o,w,u,c,p,n
}
 unterbindet eine Benachrichtigung
 Bezug: Zustand des Master-Services
Open Source Monitoring Conference 2009 © Wolfgang Barth 25
Same Host Dependency
service_dependency {
hostgroup_name WEB ;master
service_description NRPE ;master
dependent_host_name web01
dependent_service_description Disks
notification_failure_criteria w,u,c
}
 durch Weglassen des Client-Hosts ist ab
Nagios 3.0 der sinnvolle Einsatz von
Hostgruppen möglich
Open Source Monitoring Conference 2009 © Wolfgang Barth 26
Service-Dependencies:
weitere Parameter
● dependency_period
– zeitliche Einschränkung der Abhängigkeit
● inherit_parents=0
– bei Dependency-Verkettungen:
normalerweise gilt die Dependency nur
unmittelbar und wird nicht vererbt
● execution_failure_criteria
– zur Unterbindung weiterer Checks
– für Notifications nur indirekt relevant
Open Source Monitoring Conference 2009 © Wolfgang Barth 27
Host-Dependencies (I)
pc01 pc02 pc03 srv01 srv02 nagios
switch1
switch2
pc04
pc05
pc06
proxy
gate
internet-
server
http://www.swobspace.de
Firewall
DNS
UP
DOWN
UNREACHABLE
UNREACHABLE
UNREACHABLE
1CRITICAL
2
3
4
5
6
Abbildung entnommen aus: „Nagios – System und Netzwerk-Monitoring“, 2. Auflage, Open Source Press, Seite 92
Open Source Monitoring Conference 2009 © Wolfgang Barth 28
Host-Dependencies (II)
● einfachste Lösung: parents
– builtin ohne zusätzlichen Aufwand
● Host-Dependencies erlauben
Abhängigkeiten außerhalb der
normalen Topologie
● Predictive Dependency Checks
– enable_predictive_host_dependency_checks
– enable_predictive_service_dependency_checks
Open Source Monitoring Conference 2009 © Wolfgang Barth 29
Weitere Einflussgrößen:
Flapping
Acknowledgements
Scheduled Downtime
Open Source Monitoring Conference 2009 © Wolfgang Barth 30
Flapping
● Nagios speichert die letzten 21 Zustände
● Flapping ein: > high_*flap_threshold (20.0)
● Flapping aus: < low_*flap_threshold (5.0)
● Bei Beginn/Ende eine eigene Nachricht vom
Typ „FLAPPINGSTART“, „FLAPPINGSTOP“ bei:
– notification_options = f
OK
WARNING
CRITICAL
UNKNOWN
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
12/20=60%
gewichtet:
=62,21%
Open Source Monitoring Conference 2009 © Wolfgang Barth 31
Scheduled Downtime
● Unterbindet Benachrichtigungen
während der Downtime
● notification_options = s
– Beim Start (DOWNTIMESTART)
– Beim Ende (DOWNTIMEEND)
– bei Abbruch (DOWNTIMECANCELLED)
Open Source Monitoring Conference 2009 © Wolfgang Barth 32
Acknowledgements (I)
● verhindern weitere Benachrichtigungen zu
Fehlerzuständen
● Nachricht vom Typ „ACKNOWLEDGEMENT“
beim Setzen des ACKs
● notification_options = ...
– zur Zeit nicht implementiert
Open Source Monitoring Conference 2009 © Wolfgang Barth 33
Acknowledgements (II)
● Benachrichtigung heißt: es hat noch
niemand reagiert
● Differenzierung bereits bestätigter
Fehler über die Weboberfläche:
status.cgi?host=all&type=detail
&hoststatustypes=3&serviceprops=42
&servicestatustypes=28
Open Source Monitoring Conference 2009 © Wolfgang Barth 34
status.cgi
● servicestatustypes = 28
– 4: WARNING
– 8: UNKNOWN
– 16: CRITICAL
● serviceprops = 42
– 2: keine geplante Downtime
– 8: kein Acknowledgement
– 32: Service-Check aktiviert
Open Source Monitoring Conference 2009 © Wolfgang Barth 35
Custom Notifications
● „External Command File“-Schnittstelle
● ermöglicht zusätzliche Notifications
● weiterhin an Host/Service gebunden
● Optionen (Bitmaske):
– 0: keine Option
– 1: Broadcast: normale + eskalierte Kontakte
– 2: Force: unabhängig von zeitlichen Schranken
– 4: erhöht den Notification Counter (muss
explizit mit angegeben werden!)
SEND_CUSTOM_HOST_NOTIFICATION;host;opts;who;comment
SEND_CUSTOM_SVC_NOTIFICATION;host;svc;opts;who;comment
Open Source Monitoring Conference 2009 © Wolfgang Barth 36
External Command File
#!/bin/sh
now=`date +%s`
commandfile='/var/lib/nagios3/rw/nagios.cmd'
cmd='SET_HOST_NOTIFICATION_NUMBER;web01;0'
/bin/printf "[%lu] $cmdn“, $now > $commandfile
Beispielskripte unter
old.nagios.org/developerinfo/externalcommands/
Open Source Monitoring Conference 2009 © Wolfgang Barth 37
das wars ...
Vielen Dank
für Ihre Aufmerksamkeit.
Fragen?
Open Source Monitoring Conference 2009 © Wolfgang Barth 38
timeperiod-Objekt
2008-06-09 00:00-24:00
june 1 00:00-24:00
day 2 00:00-24:00
monday 1 00:00-24:00
monday 2 june 00:00-24:00
monday 00:00-24:00
2008-06-09 - 2008-06-12 00:00-24:00
2008-06-09 - 2008-06-15 / 2 00:00-24:00
exclude tp1,tp2,tp3

Weitere ähnliche Inhalte

Ähnlich wie OSMC 2009 | Das Nagios-Benachrichtigungssystem (Grundlagen, Escalations, Dependencies, Workflow) by Wolfgang Barth

The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...Klaus Bild
 
OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...
OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...
OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...NETWAYS
 
Vagrant - Einführung & Verwendung
Vagrant - Einführung & VerwendungVagrant - Einführung & Verwendung
Vagrant - Einführung & VerwendungTilo Baller
 
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...NETWAYS
 
OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...
OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...
OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...NETWAYS
 
OSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus Thiel
OSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus ThielOSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus Thiel
OSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus ThielNETWAYS
 
Nagios Conference 2007 | Eventverarbeitung mit Nagios by Michael Streb
Nagios Conference 2007 | Eventverarbeitung mit Nagios by Michael StrebNagios Conference 2007 | Eventverarbeitung mit Nagios by Michael Streb
Nagios Conference 2007 | Eventverarbeitung mit Nagios by Michael StrebNETWAYS
 
SplunkLive! München - Flughafen München
SplunkLive! München - Flughafen MünchenSplunkLive! München - Flughafen München
SplunkLive! München - Flughafen MünchenSplunk
 
Grundlagen puppet
Grundlagen puppetGrundlagen puppet
Grundlagen puppetinovex GmbH
 
OSMC 2010 | Livestatus und Multsite by Mathias Kettner
OSMC 2010 | Livestatus und Multsite by Mathias KettnerOSMC 2010 | Livestatus und Multsite by Mathias Kettner
OSMC 2010 | Livestatus und Multsite by Mathias KettnerNETWAYS
 
Tk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuTk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuWerner Fischer
 
OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...
OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...
OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...NETWAYS
 
OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...
OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...
OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...NETWAYS
 
Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)
Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)
Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)NETWAYS
 
Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)
Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)
Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)NETWAYS
 
Monitoring von SAP mit check_sap_health
Monitoring von SAP mit check_sap_healthMonitoring von SAP mit check_sap_health
Monitoring von SAP mit check_sap_healthGerhard Lausser
 
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMPSNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMPadesso AG
 
Sicheres Anwendungs-Monitoring mit SNMP
Sicheres Anwendungs-Monitoring mit SNMPSicheres Anwendungs-Monitoring mit SNMP
Sicheres Anwendungs-Monitoring mit SNMPGerrit Beine
 
OSMC 2014 | Business Prozessmonitoring mit BPView by René Koch
OSMC 2014 | Business Prozessmonitoring mit BPView by René KochOSMC 2014 | Business Prozessmonitoring mit BPView by René Koch
OSMC 2014 | Business Prozessmonitoring mit BPView by René KochNETWAYS
 

Ähnlich wie OSMC 2009 | Das Nagios-Benachrichtigungssystem (Grundlagen, Escalations, Dependencies, Workflow) by Wolfgang Barth (20)

The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
The Best Things in Life Are Free – Wie Sie Ihre IBM ConnecEons Umgebung koste...
 
OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...
OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...
OSMC 2009 | Entwicklung von Nagios-Plugins mit Net::SNMP und Nagios::Plugin b...
 
Vagrant - Einführung & Verwendung
Vagrant - Einführung & VerwendungVagrant - Einführung & Verwendung
Vagrant - Einführung & Verwendung
 
Fehleranalyse in SCCM
Fehleranalyse in SCCMFehleranalyse in SCCM
Fehleranalyse in SCCM
 
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
 
OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...
OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...
OSMC 2013 | Monitoring als Quelle der Wahrheit im Wellendeployment einer dyna...
 
OSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus Thiel
OSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus ThielOSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus Thiel
OSMC 2008 | Monitoring von Messaging Systemen mit Nagios by Markus Thiel
 
Nagios Conference 2007 | Eventverarbeitung mit Nagios by Michael Streb
Nagios Conference 2007 | Eventverarbeitung mit Nagios by Michael StrebNagios Conference 2007 | Eventverarbeitung mit Nagios by Michael Streb
Nagios Conference 2007 | Eventverarbeitung mit Nagios by Michael Streb
 
SplunkLive! München - Flughafen München
SplunkLive! München - Flughafen MünchenSplunkLive! München - Flughafen München
SplunkLive! München - Flughafen München
 
Grundlagen puppet
Grundlagen puppetGrundlagen puppet
Grundlagen puppet
 
OSMC 2010 | Livestatus und Multsite by Mathias Kettner
OSMC 2010 | Livestatus und Multsite by Mathias KettnerOSMC 2010 | Livestatus und Multsite by Mathias Kettner
OSMC 2010 | Livestatus und Multsite by Mathias Kettner
 
Tk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuTk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneu
 
OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...
OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...
OSMC 2014: Monitoring von Netzwerkkomponenten mit check_nwc_health | Gerhard ...
 
OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...
OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...
OSMC 2013 | Puppet konfiguriert Nagios automatisch by Bernd Strößenreuther / ...
 
Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)
Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)
Icinga 2: Enterprise Monitoring der nächsten Generation (Webinar vom 22.07.2014)
 
Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)
Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)
Webinar Icinga 2: Enterprise Monitoring der nächsten Generation (22.07.2014)
 
Monitoring von SAP mit check_sap_health
Monitoring von SAP mit check_sap_healthMonitoring von SAP mit check_sap_health
Monitoring von SAP mit check_sap_health
 
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMPSNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
 
Sicheres Anwendungs-Monitoring mit SNMP
Sicheres Anwendungs-Monitoring mit SNMPSicheres Anwendungs-Monitoring mit SNMP
Sicheres Anwendungs-Monitoring mit SNMP
 
OSMC 2014 | Business Prozessmonitoring mit BPView by René Koch
OSMC 2014 | Business Prozessmonitoring mit BPView by René KochOSMC 2014 | Business Prozessmonitoring mit BPView by René Koch
OSMC 2014 | Business Prozessmonitoring mit BPView by René Koch
 

OSMC 2009 | Das Nagios-Benachrichtigungssystem (Grundlagen, Escalations, Dependencies, Workflow) by Wolfgang Barth

  • 1. Open Source Monitoring Conference 2009 © Wolfgang Barth 1 Das Nagios- Benachrichtigungssystem Grundlagen, Eskalationen, Dependencies, Workflow Nürnberg, 2009-10-29
  • 2. Open Source Monitoring Conference 2009 © Wolfgang Barth 2 Agenda ● Grundlagen ● Eskalationen, Dependencies ● Einflussfaktoren: Flapping, Downtime, Acknowledgements ● Custom Notifications
  • 3. Open Source Monitoring Conference 2009 © Wolfgang Barth 3 Benachrichtigungen ● Direkte Information von Verantwortlichen (push statt pull wie bei der Weboberfläche ● Auslöser für eine Benachrichtigung: – Ein Hard State wechselt in einen anderen Hard State – Ein Hard State mit Fehlerzustand besteht weiterhin > notification_period > is_volatile
  • 4. Open Source Monitoring Conference 2009 © Wolfgang Barth 4 Einflussmöglichkeiten statisch: ● Konfiguration – System – Host, Service – Kontakt ● Eskalationen dynamisch: ● Acknowledgements ● Downtime ● Flapping ● Dependencies
  • 5. Open Source Monitoring Conference 2009 © Wolfgang Barth 5 Konfigurations- möglichkeiten Host/ Service System Kontakt Command enable_notfications=1 notfications_enabled=1 Filter (was, wann, wer, wie oft) host/service_notfications_enabled=1 Filter (was, wann, wie) E-Mail, SMS, Ampel, ... ... alles, was sich mit einem Programm ansteuern lässt ... tactical overview
  • 6. Open Source Monitoring Conference 2009 © Wolfgang Barth 6 Notifications: Parameter Host Service notification_period notification_options notification_interval first_notification_delay Contact/ -group host_notification_period host_notification_options service_notification_period service_notification_options Command externes Programm, z.B. E- Mail, SMS, Webservice, ...
  • 7. Open Source Monitoring Conference 2009 © Wolfgang Barth 7 Notifications: Was Host Service notification_period notification_options notification_interval first_notification_delay Contact/ -group host_notification_period host_notification_options service_notification_period service_notification_options Command externes Programm, z.B. E- Mail, SMS, Webservice, ...
  • 8. Open Source Monitoring Conference 2009 © Wolfgang Barth 8 notification_options Host: – d: down – u: unreachable – r: recovery – f: flapping – s: scheduled downtime – n: “none“ – a: „all“ (*) Service: – w: warning – u: unknown – c: critical – r: recovery – f: flapping – s: scheduled downtime – n: „none“ – a: „all“ (*) (*) undokumentiert
  • 9. Open Source Monitoring Conference 2009 © Wolfgang Barth 9 Notifications: Wann Host Service notification_period notification_options notification_interval first_notification_delay Contact/ -group host_notification_period host_notification_options service_notification_period service_notification_options Command externes Programm, z.B. E- Mail, SMS, Webservice, ...
  • 10. Open Source Monitoring Conference 2009 © Wolfgang Barth 10 n*_period, n*_interval ● notification_period: – timeperiod-Objekt – Zeitraum, in dem die Benachrichtigungen generiert (Host/Service) oder gefiltert (Kontakt) werden ● notification_interval: – Wiederholungsintervall ● delay_first_notification: – Verzögert die erste Nachricht
  • 11. Open Source Monitoring Conference 2009 © Wolfgang Barth 11 Timing-Beispiel (I) define service { ... check_interval = 15 ; (min) max_check_attempts = 1 ; notification_period = 9x5 ; (8h-17h) notification_interval = 120 ; (min) ... } 7h 8h 9h 10h Fehler 1. Nachricht 2. Nachricht 7h30
  • 12. Open Source Monitoring Conference 2009 © Wolfgang Barth 12 Timing-Beispiel (II) define service { ... notification_period = 7x24 ; (immer) ... } define contact { notification_period = 9x5 ; (8h-17h) } 7h 8h 9h 10h Fehler 1. Nachricht 2. Nachricht 7h30 9h30
  • 13. Open Source Monitoring Conference 2009 © Wolfgang Barth 13 Timing-Beispiel (III) define service { ... notification_period = 7x24 ; (immer) first_notification_delay = 15 ; (min) ... } define contact { notification_period = 9x5 ; (8h-17h) } 7h 8h 9h 10h Fehler 1. Nachricht 7h30 2. Nachricht 9h45
  • 14. Open Source Monitoring Conference 2009 © Wolfgang Barth 14 Notifications: Wer Host Service contactgroups contacts Contact/ -group host_notification_period host_notification_options service_notification_period service_notification_options Command externes Programm, z.B. E- Mail, SMS, Webservice, ...
  • 15. Open Source Monitoring Conference 2009 © Wolfgang Barth 15 Generiert/gefiltert Host Service Contact/ -group Command Nachricht ist generiert Nachricht ist gefiltert
  • 16. Open Source Monitoring Conference 2009 © Wolfgang Barth 16 is_volatile=1 ● nur bei Services vorhanden ● Benachrichtigung bei jedem „Non-OK Hard State“ Ergebnis ● notification_interval = deaktiviert ● sinnvoll bei Services, die sich selbst zurücksetzen: – Counter in aktiven Netzwerkkomponenten – Logfile-Überwachung
  • 17. Open Source Monitoring Conference 2009 © Wolfgang Barth 17 Notifications: Wie Host Service Contact/ -group host_notification_commands service_notification_commands Command externes Programm, z.B. E- Mail, SMS, Webservice, ...
  • 18. Open Source Monitoring Conference 2009 © Wolfgang Barth 18 *_notification_commands (I) ● wie jedes andere command-Objekt: define command{ command_name notify-by-email command_line /usr/bin/printf "%b" "***** Nagios *****nn Notification Type: $NOTIFICATIONTYPE$nn Service: $SERVICEDESC$n Host: $HOSTNAME$n Address: $HOSTADDRESS$n State: $SERVICESTATE$nn Date/Time: $LONGDATETIME$n Duration: $SERVICEDURATION$nn Additional Info:nn $SERVICEOUTPUT$" | /usr/bin/mail -s "$NOTIFICATIONTYPE$ alert - $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$ }
  • 19. Open Source Monitoring Conference 2009 © Wolfgang Barth 19 *_notification_commands (II) ● Alternative: externes Skript, das Environment-Variablen verwendet: $HOSTNAME$ -> $NAGIOS_HOSTNAME ● wichtig: enable_environment_macros = 1
  • 20. Open Source Monitoring Conference 2009 © Wolfgang Barth 20 Eskalationen & Dependencies
  • 21. Open Source Monitoring Conference 2009 © Wolfgang Barth 21 Eskalationen (I) ● Wann wird welcher Kontakt informiert? ➔ „wann“ = Anzahl der Benachrichtigungen 1 2 3 4 5 6 7 8 9 10 11 admins admins, secondlevel GF ..3 4..8 7..10 Anzahl der Nachrichten
  • 22. Open Source Monitoring Conference 2009 © Wolfgang Barth 22 Eskalationen (II) serviceescalation { host_name web01 service_description HTTP first_notification 4 last_notification 8 notification_interval 60 contact_groups admins,secondlevel escalation_period 7x24 escalation_options c,r ; w,u ...} Überlappungen
  • 23. Open Source Monitoring Conference 2009 © Wolfgang Barth 23 Service-Dependencies (I) web01 Disks web01 Users web01 Load web01 NRPE Nagios host_name service_description dependent_host_name dependent_service_desc*
  • 24. Open Source Monitoring Conference 2009 © Wolfgang Barth 24 Service-Dependencies (II) service_dependency { host_name web01 ;master service_description NRPE ;master dependent_host_name web01 dependent_service_description Disks notification_failure_criteria o,w,u,c,p,n }  unterbindet eine Benachrichtigung  Bezug: Zustand des Master-Services
  • 25. Open Source Monitoring Conference 2009 © Wolfgang Barth 25 Same Host Dependency service_dependency { hostgroup_name WEB ;master service_description NRPE ;master dependent_host_name web01 dependent_service_description Disks notification_failure_criteria w,u,c }  durch Weglassen des Client-Hosts ist ab Nagios 3.0 der sinnvolle Einsatz von Hostgruppen möglich
  • 26. Open Source Monitoring Conference 2009 © Wolfgang Barth 26 Service-Dependencies: weitere Parameter ● dependency_period – zeitliche Einschränkung der Abhängigkeit ● inherit_parents=0 – bei Dependency-Verkettungen: normalerweise gilt die Dependency nur unmittelbar und wird nicht vererbt ● execution_failure_criteria – zur Unterbindung weiterer Checks – für Notifications nur indirekt relevant
  • 27. Open Source Monitoring Conference 2009 © Wolfgang Barth 27 Host-Dependencies (I) pc01 pc02 pc03 srv01 srv02 nagios switch1 switch2 pc04 pc05 pc06 proxy gate internet- server http://www.swobspace.de Firewall DNS UP DOWN UNREACHABLE UNREACHABLE UNREACHABLE 1CRITICAL 2 3 4 5 6 Abbildung entnommen aus: „Nagios – System und Netzwerk-Monitoring“, 2. Auflage, Open Source Press, Seite 92
  • 28. Open Source Monitoring Conference 2009 © Wolfgang Barth 28 Host-Dependencies (II) ● einfachste Lösung: parents – builtin ohne zusätzlichen Aufwand ● Host-Dependencies erlauben Abhängigkeiten außerhalb der normalen Topologie ● Predictive Dependency Checks – enable_predictive_host_dependency_checks – enable_predictive_service_dependency_checks
  • 29. Open Source Monitoring Conference 2009 © Wolfgang Barth 29 Weitere Einflussgrößen: Flapping Acknowledgements Scheduled Downtime
  • 30. Open Source Monitoring Conference 2009 © Wolfgang Barth 30 Flapping ● Nagios speichert die letzten 21 Zustände ● Flapping ein: > high_*flap_threshold (20.0) ● Flapping aus: < low_*flap_threshold (5.0) ● Bei Beginn/Ende eine eigene Nachricht vom Typ „FLAPPINGSTART“, „FLAPPINGSTOP“ bei: – notification_options = f OK WARNING CRITICAL UNKNOWN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 12/20=60% gewichtet: =62,21%
  • 31. Open Source Monitoring Conference 2009 © Wolfgang Barth 31 Scheduled Downtime ● Unterbindet Benachrichtigungen während der Downtime ● notification_options = s – Beim Start (DOWNTIMESTART) – Beim Ende (DOWNTIMEEND) – bei Abbruch (DOWNTIMECANCELLED)
  • 32. Open Source Monitoring Conference 2009 © Wolfgang Barth 32 Acknowledgements (I) ● verhindern weitere Benachrichtigungen zu Fehlerzuständen ● Nachricht vom Typ „ACKNOWLEDGEMENT“ beim Setzen des ACKs ● notification_options = ... – zur Zeit nicht implementiert
  • 33. Open Source Monitoring Conference 2009 © Wolfgang Barth 33 Acknowledgements (II) ● Benachrichtigung heißt: es hat noch niemand reagiert ● Differenzierung bereits bestätigter Fehler über die Weboberfläche: status.cgi?host=all&type=detail &hoststatustypes=3&serviceprops=42 &servicestatustypes=28
  • 34. Open Source Monitoring Conference 2009 © Wolfgang Barth 34 status.cgi ● servicestatustypes = 28 – 4: WARNING – 8: UNKNOWN – 16: CRITICAL ● serviceprops = 42 – 2: keine geplante Downtime – 8: kein Acknowledgement – 32: Service-Check aktiviert
  • 35. Open Source Monitoring Conference 2009 © Wolfgang Barth 35 Custom Notifications ● „External Command File“-Schnittstelle ● ermöglicht zusätzliche Notifications ● weiterhin an Host/Service gebunden ● Optionen (Bitmaske): – 0: keine Option – 1: Broadcast: normale + eskalierte Kontakte – 2: Force: unabhängig von zeitlichen Schranken – 4: erhöht den Notification Counter (muss explizit mit angegeben werden!) SEND_CUSTOM_HOST_NOTIFICATION;host;opts;who;comment SEND_CUSTOM_SVC_NOTIFICATION;host;svc;opts;who;comment
  • 36. Open Source Monitoring Conference 2009 © Wolfgang Barth 36 External Command File #!/bin/sh now=`date +%s` commandfile='/var/lib/nagios3/rw/nagios.cmd' cmd='SET_HOST_NOTIFICATION_NUMBER;web01;0' /bin/printf "[%lu] $cmdn“, $now > $commandfile Beispielskripte unter old.nagios.org/developerinfo/externalcommands/
  • 37. Open Source Monitoring Conference 2009 © Wolfgang Barth 37 das wars ... Vielen Dank für Ihre Aufmerksamkeit. Fragen?
  • 38. Open Source Monitoring Conference 2009 © Wolfgang Barth 38 timeperiod-Objekt 2008-06-09 00:00-24:00 june 1 00:00-24:00 day 2 00:00-24:00 monday 1 00:00-24:00 monday 2 june 00:00-24:00 monday 00:00-24:00 2008-06-09 - 2008-06-12 00:00-24:00 2008-06-09 - 2008-06-15 / 2 00:00-24:00 exclude tp1,tp2,tp3