summaryrefslogtreecommitdiffstats
path: root/Monitoring/nagios/shinken/shinken-specific-high-availability.cfg
blob: f8c6001d4d6d4df6c989b26388c4659a2bcbaf35 (plain)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#This config file defines Shinken specific objects like
#satellites or Realms
#
#This file is for defining a pure high availability environnement
#That means that if a satellite die, it will be replaced
#There is only one Realm with every components into it
#All you need to to is to replace "node1" and "node2" by the DNS
#names of your Shinken servers


#The scheduler is a "Host manager". It gets the hosts and theirs
#services and it schedules the checks for the pollers.
define scheduler{
       scheduler_name	scheduler-master
       address	node1
       port	7768
       spare	0	;is not a spare
       realm	All
       weight		1       ;optionnal : 1
       }


#The second scheduler, the slave one
define scheduler{
       scheduler_name	scheduler-slave
       address	node2
       port	7768
       spare	1	;is a spare
       realm	All
       weight		1       ;optionnal : 1
       }


#Reactionner launches notifications
define reactionner{
       reactionner_name	reactionner-master
       address	node1
       port	7769
       spare	0
       realm 	All
       manage_sub_realms 0	;optionnal : 1
       min_workers	 1	;optionnal : 1
       max_workers	 15	;optionnal : 30
       polling_interval		1       ;optionnal : 1
       }


#Reactionner launches notifications
#The slave one
define reactionner{
       reactionner_name	reactionner-slave
       address	node2
       port	7769
       spare	1
       realm 	All
       manage_sub_realms 0	;optionnal : 1
       min_workers	 1	;optionnal : 1
       max_workers	 15	;optionnal : 30
       polling_interval		1       ;optionnal : 1
       }


#Pollers are here to launch checks
define poller{
       poller_name     poller-master
       address  node1
       port     7771
       realm	All
       spare	0
       manage_sub_realms 0	;optionnal : 0
       min_workers	 4	;optionnal : 1
       max_workers	 4	;optionnal : 30
       processes_by_worker	256	   ;optionnal : 256
       polling_interval		1       ;optionnal : 1
}


#Pollers are here to launch checks
define poller{
       poller_name     poller-slave
       address  node2
       port     7771
       realm	All
       spare	1
       manage_sub_realms 0	;optionnal : 0
       min_workers	 4	;optionnal : 1
       max_workers	 4	;optionnal : 30
       processes_by_worker	256	   ;optionnal : 256
       polling_interval		1       ;optionnal : 1
}


#The arbiter definition IS important : without 2 defined arbiter,
#there is no high availability
define arbiter{
       arbiter_name	Arbiter-master
       host_name	node1       ;result of the get_hostname.py command (or hostname under Unix)
       address	node1
       port	7770
       spare	0
       #modules		 No module for now
       }

#the slave, waiting patiently for its master to die
define arbiter{
       arbiter_name	Arbiter-slave
       host_name	node2       ;result of the get_hostname.py command (or hostname under Unix)
       address	node2
       port	7770
       spare	1
       #modules		 No module for now
       }



#The broker manages data export (in flat file or in database)
#Here just log files and status.dat file
define broker{
       broker_name	broker-master
       address	node1
       port	7772
       spare	0
       realm 	All
       manage_sub_realms 1
       manage_arbiters	 1
       modules		 Status-Dat, Simple-log
       }



#The broker manages data export (in flat file or in database)
#Here just log files and status.dat file
define broker{
       broker_name	broker-slave
       address	node2
       port	7772
       spare	1
       realm 	All
       manage_sub_realms 1
       manage_arbiters	 1
       modules		 Status-Dat, Simple-log
       }


##Now the modules for broker

#Here the NDO/MySQL module
#So you can use with NagVis or Centreon
define module{
       module_name	ToNdodb_Mysql
       module_type	ndodb_mysql
       database		ndo      ; database name
       user		root     ; user of the database
       password		root     ; must be changed
       host		localhost ; host to connect
       character_set	utf8     ;optionnal, UTF8 is the default
}

#Here a NDO/Oracle module. For Icinga web connection
#Or for database admin that do not like MySQL
define module{
       module_name	ToNdodb_Oracle
       module_type	ndodb_oracle
       database		XE              ;database name (listener in fact)
       user		system
       password		password        ;Yes I know I have to change my default password...
       oracle_home      /usr/lib/oracle/xe/app/oracle/product/10.2.0/server     ;optional
}


#Here for Merlin/MySQL. for Ninja connection
define module{
       module_name      ToMerlindb_Mysql
       module_type      merlindb
       backend          mysql    ;backend to use, here mysql databse
       database         merlin   ;database name
       user             root
       password         root
       host		localhost
       character_set    utf8     ;optionnal, UTF8 is the default
}


#Here the Merlin/Sqlite. No one uses it for now :)
define module{
       module_name      ToMerlindb_Sqlite
       module_type      merlindb
       backend		sqlite 	  ;like the mysql, but sqlite :)
       database_path    /tmp/mabase.sqlite  ;path of the sqlite file
}


#Here the couchdb export. Maybe use one day...
define module{
       module_name      ToCouchdb
       module_type      couchdb
       user             root
       password         root
       host		localhost
}


#Export services perfdata to file
define module{
       module_name      Service-Perfdata
       module_type      service_perfdata
       path		service-perfdata
}


#For hosts this time
define module{
       module_name      Host-Perfdata
       module_type      host_perfdata
       path		host-perfdata
}


#The log managment
define module{
       module_name      Simple-log
       module_type      simple_log
       path		/var/log/shinken/nagios.log
}


#Status.dat and objects.cache export. For the old Nagios
#interface
define module{
       module_name      Status-Dat
       module_type      status_dat
       status_file	status.dat
       object_cache_file	objects.cache
       status_update_interval   15
}


#A global Realm
define realm{
       realm_name  All
       default		1
}




##Now addon about standard configuration :
#resultmodulation : change "on te fly" a check result, without negate or something like it
#escalation : like service_escalation, but a generic that host/service can call

#A result modulation is use to module a check result, like CRITICAL->WARNING here
define resultmodulation{
       resultmodulation_name     critical_is_warning           ;required
       exit_codes_match          2                ;optionnal, list of code to change
       output_match              //               ;optionnal, regexp for activation of exit_code if output match
       exit_code_modulation      1                ;code that will be put if the code match
       output_modulation         s///        ;optionnal regexp to change output
       longoutput_modulation     s///      ;optionnal regexp to change long_output
       modulation_period         24×7    ;period when to apply the modulation
}


#Escalation is a generic version of service_escalation and host_escalation
#It can be called by services/hosts so it will be far more easier to be
#configured
define escalation{
       escalation_name		ToLevel2           ;required
       first_notification  	2
       last_notification   	5
       notification_interval	1
       escalation_period	24x7          ;optionnal, if none, always true
       escalation_options	d,u,r,w,c     ,optionnal, if none, all states (d,u,r,w,c)
       contacts			dbrosseau
#       contact_groups		admins
}