Académique Documents
Professionnel Documents
Culture Documents
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Remi Badonnel
Laurent Andrey, R
emi Badonnel
1/32
2/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Introduction
Nagios at a glance
Key concepts
Functional architecture
Services and service states
Nagios conguration
Object denitions
Other elements
Example scenario
Checks and their execution
Local checks
Remote checks
Advanced congurations
Conclusions
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
References
Motivations
References
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
3/32
References
Motivations
Laurent Andrey, R
emi Badonnel
4/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Key concepts
Functional architecture
Services and service states
Key concepts
Green/Yellow/Red (Ok/Warning/Critical)
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
5/32
Key concepts
Functional architecture
Services and service states
Functional architecture
config
Data Reaping
Resource State Calculation
Web Interface
log
Notification System
Filters, Contact Delivery
NAGIOS
Laurent Andrey, R
emi Badonnel
6/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Key concepts
Functional architecture
Services and service states
Architecture at run-time
Web interface
Conguration
7/32
Key concepts
Functional architecture
Services and service states
Service
Service check
Laurent Andrey, R
emi Badonnel
8/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Key concepts
Functional architecture
Services and service states
Service states
User notication can only occur when hard states are reached
Laurent Andrey, R
emi Badonnel
9/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Key concepts
Functional architecture
Services and service states
ok
ac 1
warning
ac ==mca
problem
warning
/ Hard Warning
u: L
mm
m
u
warning
m
u
mmm
ac ==mca
uu
okm; ac 1
u
problemuu
mmm
u
m
m
m
uu
vmm
warning
critical
u
u
warning
ac + +
ac + +
critical
uu
O hRRRR
4 OK
u
ac <mca
ac <mca
u
critical
RRR
u
R
uu
ac ==mca
u
ok ; ac
RR1R
problem
uu
u
RRR
u
R uu
)
/
Hard Critical
/ Soft Critical
R
X
critical
critical
Soft Warning
R
ac + +
ac <mca
Laurent Andrey, R
emi Badonnel
ac + +
ac ==mca
problem
critical
ac + +
ac < mca
ok ; ac 1 ; recovery
An Introduction to Monitoring with Nagios
critical
10/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Key concepts
Functional architecture
Services and service states
ac++ /
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
11/32
Key concepts
Functional architecture
Services and service states
ac<mca/
ac==mca
/
ac1 /
notication
/
Laurent Andrey, R
emi Badonnel
12/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Object denitions
Other elements
Example scenario
Nagios conguration
Object-oriented representation
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
13/32
Object denitions
Other elements
Example scenario
Host
Laurent Andrey, R
emi Badonnel
14/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Object denitions
Other elements
Example scenario
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
15/32
Object denitions
Other elements
Example scenario
Example scenario
dnsext
152.81.144.14
webloria
152.81.144.22
http://www.loria.fr
152.81.144.0/20
Internet
cat-481
152.81.0.0/20
nagios
152.81.9.211
dns1, preny
152.81.1.25
Laurent Andrey, R
emi Badonnel
dns2, hugo
152.81.1.128
16/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Object denitions
Other elements
Example scenario
define host {
webloria
host name
alias
w e b l o r i a l i n u x machine
address
152.81.144.22
check command
check h o s t a l i v e
max check attempts
3
check period
24 x7
notification interval
180
# 3 hours
notification period
24 x7
notification options
d,r ,f ,u
# down , r e c o v e r y , f l a p p i n g , u n r e a c h a b l e
contact groups
administrators
}
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
17/32
Object denitions
Other elements
Example scenario
define service {
host name
service description
check command
max check attempts
normal check interval
retry check interval
check period
notification interval
notification period
notification options
# warning , c r i t i c a l , r e c o v e r y
contact groups
}
Laurent Andrey, R
emi Badonnel
webloria
http s e r v i c e
check http
3
5
1
24 x7
180
24 x7
w, c , r , f , u
, flapping , unreachable
administrators
18/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Object denitions
Other elements
Example scenario
checkcommands.cfg
d e f i n e command{
command name
command line
}
check h o s t a l i v e
$USER1$/ c h e c k i c m p H $HOSTADDRESS$
d e f i n e command{
command name
command line
}
check http
$USER1$/ c h e c k h t t p H $HOSTADDRESS$
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
19/32
Object denitions
Other elements
Example scenario
define service {
host name
dnsext
service description
dns s e r v i c e
check command
check name for given dns
!www. l o r i a . f r ! 1 5 2 . 8 1 . 1 4 4 . 2 2
max check attempts
3
normal check interval
5
retry check interval
1
check period
24 x7
notification interval
180
notification period
24 x7
notification options
w, c , r , f , u
contact groups
administrators
}
Laurent Andrey, R
emi Badonnel
20/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Object denitions
Other elements
Example scenario
checkcommands.cfg
d e f i n e command{
command name c h e c k n a m e f o r g i v e n d n s
c o m m a n d l i n e $USER1$/ c h e c k d n s H $ARG1$ a $ARG2$
s $HOSTADDRESS$
# $ARG1$ : f u l l y q u a l i f i e d name
# $ARG2$ : IP a d d r e s s
}
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
21/32
Object denitions
Other elements
Example scenario
contacts.cfg
define contact {
contact name
alias
service notification period
host notification period
service notification options
host notification options
service notification commands
host notification commands
email
}
Laurent Andrey, R
emi Badonnel
andrey
l a u r e n t andrey
24 x7
24 x7
w, u , c , r
d, r
n o t i f y bye m a i l
h o s t n o t i f y bye m a i l
andrey@loria . fr
22/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Object denitions
Other elements
Example scenario
contacts.cfg
define contactgroup {
contactgroup name
alias
members
}
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
administrators
group of a d m i n i s t r a t o r s
andrey
23/32
Local checks
Remote checks
Local checks
Laurent Andrey, R
emi Badonnel
24/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Local checks
Remote checks
check_http -H http://www.esial.uhp-nancy.fr
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
25/32
Local checks
Remote checks
CLIENT
NAGIOS
sshd
(daemon)
check_by_ssh (plugin)
NETWORK
check_xyz
(plugin)
pub.key
priv.key
Laurent Andrey, R
emi Badonnel
26/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Local checks
Remote checks
CLIENT
NAGIOS
nrpe (daemon)
check_nrpe (plugin)
ref
n
tcp connectio
NETWORK
ref1
ref2
...
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
27/32
Local checks
Remote checks
Laurent Andrey, R
emi Badonnel
28/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Notion of inheritance
Factorizing many low-interest attributes
register attribute to dene a template
use attribute to inherite from a template
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
29/32
dns hosts
h o s t s s u p p o r t i n g DNS
dns1 , d n s 2 , d n s e x t
define service{
hostgroup name
service description
check command
max check attempts
normal check interval
retry check interval
check period
notification interval
notification period
notification options
contact groups
}
dns hosts
dns s e r v i c e
check name for given dns
!www . l o r i a . f r ! 1 5 2 . 8 1 . 1 4 4 . 2 2
3
5
1
24 x7
180
24 x7
w, c , r , f , u
administrators
Laurent Andrey, R
emi Badonnel
30/32
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
Specifying dependencies
Laurent Andrey, R
emi Badonnel
Introduction
Nagios at a glance
Nagios conguration
Checks and their execution
Advanced congurations
31/32
Conclusions
No discovery mechanism
Experience it during lab exercises!
Laurent Andrey, R
emi Badonnel
32/32