From: Frank Brehm Date: Fri, 3 Dec 2010 17:11:43 +0000 (+0000) Subject: Weitergemacht X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=7eb060192eeede1f34b0b56e00e11caad04b64fb;p=my-stuff%2Fnagios.git Weitergemacht git-svn-id: http://svn.brehm-online.com/svn/my-stuff/nagios/trunk@140 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa --- diff --git a/bin/nagios/cfg/struct.py b/bin/nagios/cfg/struct.py index bcc60e9..571d115 100755 --- a/bin/nagios/cfg/struct.py +++ b/bin/nagios/cfg/struct.py @@ -127,8 +127,8 @@ class NagiosConfigStruct(object): def check_line_syntax( self, line, object_type, file, rownum ): """Verifying a given line as a property of a Nagios object of given object type.""" - self.logger.debug( "Checking line {0!r} for object type {1!r} in {2!r}({3}).".format( - line, object_type, file, rownum ) ) + #self.logger.debug( "Checking line {0!r} for object type {1!r} in {2!r}({3}).".format( + # line, object_type, file, rownum ) ) if not object_type in self.get_valid_object_types(): raise NagiosConfigStructError( "Invalid object type {0!r}.".format( object_type ) ) @@ -205,9 +205,12 @@ Returns None if the key is invalid.""" 'max_check_attempts': ( 'int', None ), 'check_interval': ( 'int', None ), 'retry_interval': ( 'int', None ), + 'normal_check_interval': ( 'int', None ), + 'retry_check_interval': ( 'int', None ), 'active_checks_enabled': ( 'bool', None ), 'passive_checks_enabled': ( 'bool', None ), 'check_period': ( 'string', None ), + 'failure_prediction_enabled': ( 'bool', None ), 'obsess_over_host': ( 'bool', None ), 'check_freshness': ( 'bool', None ), 'freshness_threshold': ( 'int', None ), @@ -250,9 +253,13 @@ Returns None if the key is invalid.""" 'max_check_attempts': ( 'int', None ), 'check_interval': ( 'int', None ), 'retry_interval': ( 'int', None ), + 'normal_check_interval': ( 'int', None ), + 'retry_check_interval': ( 'int', None ), 'active_checks_enabled': ( 'bool', None ), 'passive_checks_enabled': ( 'bool', None ), + 'parallelize_check': ( 'bool', None ), 'check_period': ( 'string', None ), + 'failure_prediction_enabled': ( 'bool', None ), 'obsess_over_service': ( 'bool', None ), 'check_freshness': ( 'bool', None ), 'freshness_threshold': ( 'int', None ), @@ -316,6 +323,47 @@ Returns None if the key is invalid.""" 'retain_status_information': ( 'bool', None ), 'retain_nonstatus_information': ( 'bool', None ), }, + 'contactgroup': { + 'contactgroup_name': ( 'string', None ), + 'alias': ( 'string', None ), + 'members': ( 'array', None ), + 'contactgroup_members': ( 'array', None ), + }, + 'timeperiod': { + 'timeperiod_name': ( 'string', None ), + 'alias': ( 'string', None ), + #'[weekday]': timeranges + #'[exception]': timeranges + 'exclude': ( 'array', None ), + }, + 'command': { + 'command_name': ( 'string', None ), + 'command_line': ( 'string', None ), + }, + 'servicedependency': { + 'dependent_host_name': ( 'array', None ), + 'dependent_hostgroup_name': ( 'array', None ), + 'dependent_service_description': ( 'array', None ), + 'host_name': ( 'array', None ), + 'hostgroup_name': ( 'array', None ), + 'service_description': ( 'array', None ), + 'inherits_parent': ( 'bool', None ), + 'execution_failure_criteria': ( 'set', { 'valid_values': set( [ 'o', 'w', 'u', 'c', 'p', 'n' ] ) } ), #[o,w,u,c,p,n] + 'notification_failure_criteria': ( 'set', { 'valid_values': set( [ 'o', 'w', 'u', 'c', 'p', 'n' ] ) } ), #[o,w,u,c,p,n] + 'dependency_period': ( 'string', None ), + }, + 'serviceescalation': { + 'host_name': ( 'array', None ), + 'hostgroup_name': ( 'array', None ), + 'service_description': ( 'string', None ), + 'contacts': ( 'array', None ), + 'contact_groups': ( 'array', None ), + 'first_notification': ( 'int', None ), + 'last_notification': ( 'int', None ), + 'notification_interval': ( 'int', None ), + 'escalation_period': ( 'string', None ), + 'escalation_options': ( 'set', { 'valid_values': set( [ 'w', 'u', 'c', 'r' ] ) } ), #[w,u,c,r] + }, } if object_type not in key_def: diff --git a/bin/nagios/config.py b/bin/nagios/config.py index a6c231e..ee1ca9c 100644 --- a/bin/nagios/config.py +++ b/bin/nagios/config.py @@ -324,7 +324,7 @@ class NagiosConfig(object): if ( key == None ): self.logger.debug( "nothing found." ) else: - self.logger.debug( "Found: key: {0!r}, value: {1!r}".format( key, value ) ) + # self.logger.debug( "Found: key: {0!r}, value: {1!r}".format( key, value ) ) if key in cur_object: self.logger.warn( "Double entry of property {0!r} as {1!r} in {2}({3}).".format( key, object_type, file_name, row_num ) )