1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
Introduction/Notes
==================
This modules was inspired and based on the work of David Schmitt
The immerda project group adapted and improved this module.
Mainly we made it using the new native puppet nagios commands
as well we made it more modular to fit for multidistro usage.
However as we used Centos, we couldn't test the original Debian
extension of David Schmitt, integration of more distros have to prove
this concept.
Overview
========
To use the nagios resources, activate storeconfigs on the puppetmaster.
Monitor
-------
On one node the "nagios" class has to be included. This installes nagios and
apache2 and installs the cgi
Hosts
-----
On a node which shall be monitored with nagios, include the "nagios::target".
This just creates a host declaration for this hosts "$fqdn".
Set the $nagios_parent variable in the node scope for enabling the reachability
features of nagios. If a node needs more customisation, use the
"nagios::host" component directly.
To monitor hosts not managed by puppet, add "nagios::extra_host"s to the
monitoring node. These can be used as intermediate $nagios_parent's
Services
--------
Services can be monitored by using the "nagios::service" component.
The simplest form is::
nagios::service { check_dns: }
The intention being obviously to put such declarations into a component defining
a service, thereby being automatically applied together with all instances of
the service.
Caveats
=======
Performance
-----------
A major drawback is that currently the needed storeconfig setting and
subsequent filling of the database is really a drag on performance. 0.22.1
for example breaks at approximatly 120 monitored services (depends on H/W of
course). 0.22.3 has improved that my a factor of 3-4.
Consistency/Validation/Verification
-----------------------------------
After convergance of the configuration, the system is obviously consistent.
That is, all defined services are monitored. The problem is though, that it is
neither automatically valid - it is not guaranteed that all components declare a
nagios::service - and even if the configuration is valid it definitly is
unverified, since that is always a judgment call for an external observer.
Examples
========
Usage example::
node nagios {
include nagios
# Declare another nagios command
nagios::command { http_port: command_line
=> '/usr/lib/nagios/plugins/check_http -p $ARG1$ -H $HOSTADDRESS$ -I
$HOSTADDRESS$'
# Declare unmanaged hosts
nagios_extra_host {
"router01":
parent => "gateway",
ip => "10.0.0.1";
"router02":
parent => "router01",
ip => "192.168.0.1";
}
}
node target {
# Monitor this host
$nagios_parent = "router01"
include nagios_target
# monitor a service
$apache2_port = 8080
include apache2
# This actually does this somewhere:
#nagios::service { "http_${apache2_port}":
# check_command => "http_port!${apache2_port}"
#}
}
License
=======
Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
See the file LICENSE in the top directory for the full license.
|