f37 -> f39
[infrastructure.git] / nagios / AutomaticConfig / config-sample.old / localhost.cfg-sample
1 ###############################################################################
2 # LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
3 #
4 # Last Modified: 11-27-2006
5 #
6 # NOTE: This config file is intended to servce as an *extremely* simple 
7 #       example of how you can create your object configuration file(s).
8 #
9 ###############################################################################
10
11
12
13 ###############################################################################
14 ###############################################################################
15 #
16 # TIME PERIODS
17 #
18 ###############################################################################
19 ###############################################################################
20
21 # This defines a timeperiod where all times are valid for checks, 
22 # notifications, etc.  The classic "24x7" support nightmare. :-)
23
24 define timeperiod{
25         timeperiod_name 24x7
26         alias           24 Hours A Day, 7 Days A Week
27         sunday          00:00-24:00
28         monday          00:00-24:00
29         tuesday         00:00-24:00
30         wednesday       00:00-24:00
31         thursday        00:00-24:00
32         friday          00:00-24:00
33         saturday        00:00-24:00
34         }
35
36
37 # 'workhours' timeperiod definition
38 define timeperiod{
39         timeperiod_name workhours
40         alias           "Normal" Working Hours
41         monday          09:00-17:00
42         tuesday         09:00-17:00
43         wednesday       09:00-17:00
44         thursday        09:00-17:00
45         friday          09:00-17:00
46         }
47
48
49 # 'nonworkhours' timeperiod definition
50 define timeperiod{
51         timeperiod_name nonworkhours
52         alias           Non-Work Hours
53         sunday          00:00-24:00
54         monday          00:00-09:00,17:00-24:00
55         tuesday         00:00-09:00,17:00-24:00
56         wednesday       00:00-09:00,17:00-24:00
57         thursday        00:00-09:00,17:00-24:00
58         friday          00:00-09:00,17:00-24:00
59         saturday        00:00-24:00
60         }
61
62
63 # 'none' timeperiod definition
64 define timeperiod{
65         timeperiod_name none
66         alias           No Time Is A Good Time
67         }
68
69
70
71 ###############################################################################
72 ###############################################################################
73 #
74 # COMMANDS
75 #
76 ###############################################################################
77 ###############################################################################
78
79 # NOTE: Sample command definitions can now be found in the sample commands.cfg 
80 #       file
81
82
83
84
85 ###############################################################################
86 ###############################################################################
87 #
88 # CONTACTS
89 #
90 ###############################################################################
91 ###############################################################################
92
93 # In this simple config file, a single contact will receive all alerts.
94 # This assumes that you have an account (or email alias) called
95 # "nagios-admin" on the local host.
96
97 define contact{
98         contact_name                    nagios-admin
99         alias                           Nagios Admin
100         service_notification_period     24x7
101         host_notification_period        24x7
102         service_notification_options    w,u,c,r
103         host_notification_options       d,r
104         service_notification_commands   notify-by-email
105         host_notification_commands      host-notify-by-email
106         email                           nagios-admin@localhost
107         }
108
109
110
111 ###############################################################################
112 ###############################################################################
113 #
114 # CONTACT GROUPS
115 #
116 ###############################################################################
117 ###############################################################################
118
119 # We only have one contact in this simple configuration file, so there is
120 # no need to create more than one contact group.
121
122 define contactgroup{
123         contactgroup_name       admins
124         alias                   Nagios Administrators
125         members                 nagios-admin
126         }
127
128
129
130 ###############################################################################
131 ###############################################################################
132 #
133 # HOSTS
134 #
135 ###############################################################################
136 ###############################################################################
137
138 # Generic host definition template - This is NOT a real host, just a template!
139
140 define host{
141         name                            generic-host    ; The name of this host template
142         notifications_enabled           1               ; Host notifications are enabled
143         event_handler_enabled           1               ; Host event handler is enabled
144         flap_detection_enabled          1               ; Flap detection is enabled
145         failure_prediction_enabled      1               ; Failure prediction is enabled
146         process_perf_data               1               ; Process performance data
147         retain_status_information       1               ; Retain status information across program restarts
148         retain_nonstatus_information    1               ; Retain non-status information across program restarts
149         notification_period             24x7            ; Send host notifications at any time
150         register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
151         }
152
153
154 # Linux host definition template - This is NOT a real host, just a template!
155
156 define host{
157         name                            linux-server    ; The name of this host template
158         use                             generic-host    ; This template inherits other values from the generic-host template
159         check_period                    24x7            ; By default, Linux hosts are checked round the clock
160         max_check_attempts              10              ; Check each Linux host 10 times (max)
161         check_command                   check-host-alive ; Default command to check Linux hosts
162         notification_period             workhours       ; Linux admins hate to be woken up, so we only notify during the day
163                                                         ; Note that the notification_period variable is being overridden from
164                                                         ; the value that is inherited from the generic-host template!
165         notification_interval           120             ; Resend notification every 2 hours
166         notification_options            d,u,r           ; Only send notifications for specific host states
167         contact_groups                  admins          ; Notifications get sent to the admins by default
168         register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
169         }
170
171
172 # Since this is a simple configuration file, we only monitor one host - the
173 # local host (this machine).
174
175 define host{
176         use                     linux-server            ; Name of host template to use
177                                                         ; This host definition will inherit all variables that are defined
178                                                         ; in (or inherited by) the linux-server host template definition.
179         host_name               localhost
180         alias                   localhost
181         address                 127.0.0.1
182         }
183
184
185
186 ###############################################################################
187 ###############################################################################
188 #
189 # HOST GROUPS
190 #
191 ###############################################################################
192 ###############################################################################
193
194 # We only have one host in our simple config file, so there is no need to
195 # create more than one hostgroup.
196
197 define hostgroup{
198         hostgroup_name  test
199         alias           Test Servers
200         members         localhost
201         }
202
203
204
205 ###############################################################################
206 ###############################################################################
207 #
208 # SERVICES
209 #
210 ###############################################################################
211 ###############################################################################
212
213 # Generic service definition template - This is NOT a real service, just a template!
214
215 define service{
216         name                            generic-service         ; The 'name' of this service template
217         active_checks_enabled           1                       ; Active service checks are enabled
218         passive_checks_enabled          1                       ; Passive service checks are enabled/accepted
219         parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
220         obsess_over_service             1                       ; We should obsess over this service (if necessary)
221         check_freshness                 0                       ; Default is to NOT check service 'freshness'
222         notifications_enabled           1                       ; Service notifications are enabled
223         event_handler_enabled           1                       ; Service event handler is enabled
224         flap_detection_enabled          1                       ; Flap detection is enabled
225         failure_prediction_enabled      1                       ; Failure prediction is enabled
226         process_perf_data               1                       ; Process performance data
227         retain_status_information       1                       ; Retain status information across program restarts
228         retain_nonstatus_information    1                       ; Retain non-status information across program restarts
229         is_volatile                     0                       ; The service is not volatile
230         register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
231         }
232
233
234 # Local service definition template - This is NOT a real service, just a template!
235
236 define service{
237         name                            local-service           ; The name of this service template
238         use                             generic-service         ; Inherit default values from the generic-service definition
239         check_period                    24x7                    ; The service can be checked at any time of the day
240         max_check_attempts              4                       ; Re-check the service up to 4 times in order to determine its final (hard) state
241         normal_check_interval           5                       ; Check the service every 5 minutes under normal conditions
242         retry_check_interval            1                       ; Re-check the service every minute until a hard state can be determined
243         contact_groups                  admins                  ; Notifications get sent out to everyone in the 'admins' group
244         notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events
245         notification_interval           60                      ; Re-notify about service problems every hour
246         notification_period             24x7                    ; Notifications can be sent out at any time
247         register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
248         }
249
250
251 # Define a service to "ping" the local machine
252
253 define service{
254         use                             local-service         ; Name of service template to use
255         host_name                       localhost
256         service_description             PING
257         check_command                   check_ping!100.0,20%!500.0,60%
258         }
259
260
261 # Define a service to check the disk space of the root partition
262 # on the local machine.  Warning if < 20% free, critical if
263 # < 10% free space on partition.
264
265 define service{
266         use                             local-service         ; Name of service template to use
267         host_name                       localhost
268         service_description             Root Partition
269         check_command                   check_local_disk!20%!10%!/
270         }
271
272
273
274 # Define a service to check the number of currently logged in
275 # users on the local machine.  Warning if > 20 users, critical
276 # if > 50 users.
277
278 define service{
279         use                             local-service         ; Name of service template to use
280         host_name                       localhost
281         service_description             Current Users
282         check_command                   check_local_users!20!50
283         }
284
285
286 # Define a service to check the number of currently running procs
287 # on the local machine.  Warning if > 250 processes, critical if
288 # > 400 users.
289
290 define service{
291         use                             local-service         ; Name of service template to use
292         host_name                       localhost
293         service_description             Total Processes
294         check_command                   check_local_procs!250!400!RSZDT
295         }
296
297
298
299 # Define a service to check the load on the local machine. 
300
301 define service{
302         use                             local-service         ; Name of service template to use
303         host_name                       localhost
304         service_description             Current Load
305         check_command                   check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
306         }
307
308
309