Hi,

Nagios documentation state that alias and notification_period are mandatory :
http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#host

But nagios binaries (3.2.0) treat hosts without theses parameters as valid 
configuration.

What should we follow ? documentation or implementation ? Provide a flags or 
default values ?

The attached patch default notification_period to 24x7 and alias to hostname.

Regards,

-- 
Nicolas DUPEUX <nicolas.dup...@arkea.com>
Arkea - Domaine Systèmes
tel : 02.98.00.36.68
--- host.py.orig	2010-12-07 15:39:19.000000000 +0100
+++ host.py	2010-12-07 15:48:40.000000000 +0100
@@ -85,7 +85,7 @@
         'contact_groups' : {'required' : True, 'default' : '', 'fill_brok' : ['full_status']},
         'notification_interval' : {'required' : False, 'default' : '60', 'pythonize' : to_int, 'fill_brok' : ['full_status']},
         'first_notification_delay' : {'required' : False, 'default' : '0', 'pythonize' : to_int, 'fill_brok' : ['full_status']},
-        'notification_period' : {'required' : True, 'fill_brok' : ['full_status']},
+        'notification_period' : {'required' : False, 'default' : '24x7', 'fill_brok' : ['full_status']},
         'notification_options' : {'required' : False, 'default' : 'd,u,r,f', 'pythonize' : to_split, 'fill_brok' : ['full_status']},
         'notifications_enabled' : {'required' : False, 'default' : '1', 'pythonize' : to_bool, 'fill_brok' : ['full_status']},
         'stalking_options' : {'required' : False, 'default' : '', 'pythonize' : to_split, 'fill_brok' : ['full_status']},
@@ -308,7 +308,7 @@
         cls = self.__class__
 
         special_properties = ['contacts', 'contact_groups', 'check_period', \
-                                  'notification_interval', 'check_period']
+                                  'notification_interval', 'alias']
         for prop in cls.properties:
             if prop not in special_properties:
                 if not hasattr(self, prop) and cls.properties[prop]['required']:
@@ -345,6 +345,9 @@
             state = False
         if not hasattr(self, 'check_period'):
             self.check_period = None
+	if not hasattr(self, 'alias'):
+	    logger.log("%s : default alias to hostname" % self.get_name())
+	    self.alias = self.host_name
         if hasattr(self, 'host_name'):
             for c in cls.illegal_object_name_chars:
                 if c in self.host_name:
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to