1 ###############################################################################
2 # LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
4 # Last Modified: 11-27-2006
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).
9 ###############################################################################
13 ###############################################################################
14 ###############################################################################
18 ###############################################################################
19 ###############################################################################
21 # This defines a timeperiod where all times are valid for checks,
22 # notifications, etc. The classic "24x7" support nightmare. :-)
26 alias 24 Hours A Day, 7 Days A Week
37 # 'workhours' timeperiod definition
39 timeperiod_name workhours
40 alias "Normal" Working Hours
49 # 'nonworkhours' timeperiod definition
51 timeperiod_name nonworkhours
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
63 # 'none' timeperiod definition
66 alias No Time Is A Good Time
71 ###############################################################################
72 ###############################################################################
76 ###############################################################################
77 ###############################################################################
79 # NOTE: Sample command definitions can now be found in the sample commands.cfg
85 ###############################################################################
86 ###############################################################################
90 ###############################################################################
91 ###############################################################################
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.
98 contact_name 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
111 ###############################################################################
112 ###############################################################################
116 ###############################################################################
117 ###############################################################################
119 # We only have one contact in this simple configuration file, so there is
120 # no need to create more than one contact group.
123 contactgroup_name admins
124 alias Nagios Administrators
130 ###############################################################################
131 ###############################################################################
135 ###############################################################################
136 ###############################################################################
138 # Generic host definition template - This is NOT a real host, just a template!
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!
154 # Linux host definition template - This is NOT a real host, just a template!
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!
172 # Since this is a simple configuration file, we only monitor one host - the
173 # local host (this machine).
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.
186 ###############################################################################
187 ###############################################################################
191 ###############################################################################
192 ###############################################################################
194 # We only have one host in our simple config file, so there is no need to
195 # create more than one hostgroup.
205 ###############################################################################
206 ###############################################################################
210 ###############################################################################
211 ###############################################################################
213 # Generic service definition template - This is NOT a real service, just a template!
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!
234 # Local service definition template - This is NOT a real service, just a template!
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!
251 # Define a service to "ping" the local machine
254 use local-service ; Name of service template to use
256 service_description PING
257 check_command check_ping!100.0,20%!500.0,60%
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.
266 use local-service ; Name of service template to use
268 service_description Root Partition
269 check_command check_local_disk!20%!10%!/
274 # Define a service to check the number of currently logged in
275 # users on the local machine. Warning if > 20 users, critical
279 use local-service ; Name of service template to use
281 service_description Current Users
282 check_command check_local_users!20!50
286 # Define a service to check the number of currently running procs
287 # on the local machine. Warning if > 250 processes, critical if
291 use local-service ; Name of service template to use
293 service_description Total Processes
294 check_command check_local_procs!250!400!RSZDT
299 # Define a service to check the load on the local machine.
302 use local-service ; Name of service template to use
304 service_description Current Load
305 check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0