public
Description: Puppet is a declarative language for expressing system configuration, a client and server for distributing it, and a library for realizing the configuration.
Homepage: http://reductivelabs.com/trac/puppet/
Clone URL: git://github.com/shadoi/puppet.git
Add a bunch of directives, allows a full parse of stanford's huge nagios config
Also reformatted a bit
Blake Barnett (author)
Thu Mar 27 20:36:04 -0700 2008
commit  2e88af1662123604d4fb8750da53de3595b6b5cc
tree    d8747087b3ff438770c3dc42fd805a1185f4e012
parent  af200e55e76a2066b60a85ecc00ddc2acd2c1d35
...
228
229
230
231
 
 
 
232
233
234
...
318
319
320
321
322
323
324
 
 
 
 
325
326
 
327
328
329
330
 
 
 
331
332
333
 
334
335
336
337
 
 
 
338
339
 
340
341
342
343
344
345
 
 
 
 
 
346
347
348
349
350
351
352
353
 
354
 
 
355
356
 
357
358
359
 
360
361
 
362
363
 
 
 
 
 
 
 
 
364
365
366
 
 
367
368
 
369
370
371
 
372
373
 
374
375
376
...
381
382
383
384
 
385
386
387
388
389
 
390
391
 
392
393
394
395
 
 
 
396
397
398
 
399
400
401
402
 
403
404
405
406
407
 
 
 
 
 
 
 
408
409
410
411
412
413
 
414
415
416
417
418
 
 
 
 
419
420
421
...
228
229
230
 
231
232
233
234
235
236
...
320
321
322
 
 
 
 
323
324
325
326
327
 
328
329
 
 
 
330
331
332
333
334
 
335
336
 
 
 
337
338
339
340
 
341
342
 
 
 
 
 
343
344
345
346
347
348
349
 
350
 
 
 
 
351
352
353
354
355
 
356
357
358
 
359
360
 
361
362
 
363
364
365
366
367
368
369
370
371
 
 
372
373
374
 
375
376
377
 
378
379
 
380
381
382
383
...
388
389
390
 
391
392
393
394
395
 
396
397
 
398
399
400
 
 
401
402
403
404
405
 
406
407
408
409
 
410
411
412
413
414
 
415
416
417
418
419
420
421
422
423
424
425
426
 
427
428
 
 
 
 
429
430
431
432
433
434
435
0
@@ -228,7 +228,9 @@ class Nagios::Base
0
 
0
     # This is probably a bad idea.
0
     def name=(value)
0
-        send(self.class.namevar.to_s + "=", value)
0
+        unless self.class.namevar.to_s == "name" 
0
+            send(self.class.namevar.to_s + "=", value) 
0
+        end    
0
     end
0
 
0
     def namevar
0
@@ -318,59 +320,64 @@ class Nagios::Base
0
         self.class.name
0
     end
0
 
0
-  # object types
0
-  newtype :command do
0
-    setparameters :command_name, :command_line
0
-  end
0
+    # object types
0
+    newtype :command do
0
+        setparameters :command_name, :command_line
0
+    end
0
 
0
-  newtype :contact do
0
+    newtype :contact do
0
         setparameters :contact_name, :alias, :host_notification_period,
0
-      :host_notification_commands, :service_notification_period,
0
-      :service_notification_commands,
0
-      :email, :pager, :service_notification_options, :host_notification_options
0
+            :host_notification_commands, :service_notification_period,
0
+            :service_notification_commands, :register, :email, :pager, 
0
+            :service_notification_options, :host_notification_options
0
 
0
         setsuperior "person"
0
-  end
0
+    end
0
 
0
-  newtype :contactgroup do
0
-    setparameters :contactgroup_name, :alias, :members
0
-  end
0
+    newtype :contactgroup do
0
+        setparameters :contactgroup_name, :alias, :members
0
+    end
0
 
0
-  newtype :host do
0
+    newtype :host do
0
         setparameters :host_name, :notifications_enabled, :event_handler_enabled,
0
-      :flap_detection_enabled, :process_perf_data, :retain_status_information,
0
-      :retain_nonstatus_information, :register, :use, :alias,
0
-      :address, :check_command, :max_check_attempts, :notification_interval,
0
-      :notification_period, :notification_options, :checks_enabled,
0
-            :failure_prediction_enabled, :parents
0
+            :flap_detection_enabled, :process_perf_data, :retain_status_information,
0
+            :retain_nonstatus_information, :register, :use, :alias,
0
+            :address, :check_command, :max_check_attempts, :notification_interval,
0
+            :notification_period, :notification_options, :checks_enabled,
0
+            :failure_prediction_enabled, :parents, :contact_groups
0
 
0
         setsuperior "person"
0
-
0
         map :address => "ipHostNumber"
0
-  end
0
-
0
-  newtype :hostextinfo do
0
-    auxiliary = true
0
+    end
0
 
0
+    newtype :hostextinfo do
0
+        auxiliary = true
0
         setparameters :host_name, :notes_url, :icon_image, :icon_image_alt, :vrml_image,
0
-      "2d_coords".intern, "3d_coords".intern
0
+            "2d_coords".intern, "3d_coords".intern
0
 
0
         setnamevar :host_name
0
-  end
0
+    end
0
 
0
-  newtype :hostgroup do
0
+    newtype :hostgroup do
0
         setparameters :hostgroup_name, :alias, :contact_groups, :members
0
-  end
0
+    end
0
+
0
+    newtype :hostescalation do
0
+        setparameters :name, :first_notification, :last_notification,
0
+            :notification_interval, :contact_groups,
0
+            :escalation_options, :register, :hostgroup_name
0
+        setnamevar :name
0
+    end              
0
 
0
-  newtype :hostgroupescalation do
0
-    auxiliary = true
0
+    newtype :hostgroupescalation do
0
+        auxiliary = true
0
         setparameters :hostgroup_name, :first_notification, :last_notification,
0
-      :contact_groups, :notification_interval
0
+            :contact_groups, :notification_interval
0
 
0
         setnamevar :hostgroup_name
0
-  end
0
+    end
0
 
0
-  newtype :service do
0
+    newtype :service do
0
         attach :host => :host_name
0
         setparameters :name, :active_checks_enabled, :passive_checks_enabled,
0
             :parallelize_check, :obsess_over_service, :check_freshness,
0
@@ -381,41 +388,48 @@ class Nagios::Base
0
             :normal_check_interval, :retry_check_interval, :contact_groups,
0
             :notification_interval, :notification_period, :notification_options,
0
             :service_description, :host_name, :freshness_threshold,
0
-            :check_command
0
+            :check_command, :hostgroup_name, :event_handler, :servicegroups, :host
0
 
0
         suppress :host_name
0
 
0
         setnamevar :service_description
0
-  end
0
+    end
0
 
0
-  newtype :servicedependency do
0
+    newtype :servicedependency do
0
         auxiliary = true
0
         setparameters :host_name, :service_description, :dependent_host_name,
0
-      :dependent_service_description, :execution_failure_criteria,
0
-      :notification_failure_criteria
0
+            :dependent_service_description, :execution_failure_criteria,
0
+            :notification_failure_criteria, :hostgroup_name, 
0
+            :dependent_hostgroup_name
0
 
0
         setnamevar :host_name
0
-  end
0
+    end
0
 
0
     newtype :serviceescalation do
0
         setparameters :host_name, :service_description, :first_notification,
0
-            :last_notification, :contact_groups, :notification_interval
0
+            :last_notification, :contact_groups, :notification_interval, :hostgroup_name
0
 
0
         setnamevar :host_name
0
     end
0
 
0
-  newtype :serviceextinfo do
0
+    newtype :servicegroup do
0
+        setparameters :servicegroup_name, :alias
0
+
0
+        setnamevar :servicegroup_name
0
+    end
0
+
0
+    newtype :serviceextinfo do
0
         auxiliary = true
0
 
0
         setparameters :host_name, :service_description, :icon_image, :icon_image_alt
0
 
0
         setnamevar :host_name
0
-  end
0
+    end
0
 
0
-  newtype :timeperiod do
0
-        setparameters :timeperiod_name, :alias, :sunday, :monday, :tuesday, :wednesday,
0
-      :thursday, :friday, :saturday
0
-  end
0
+    newtype :timeperiod do
0
+        setparameters :timeperiod_name, :alias, :sunday, :monday, :tuesday,
0
+            :wednesday, :thursday, :friday, :saturday
0
+    end
0
 end
0
 
0
 # $Id$

Comments