#------------------------------------------------------
def __init__( self, new_file = file_name ):
"Konstruktor."
- self.file_name = self.canonize_file(new_file)
- self.conf = {}
- self.objects = {}
- self.config_objects = {}
- self.objects_read = {}
# Logging-Setup
self.logger = logging.getLogger('nagiosConfig')
self.logger.addHandler(ch)
+ self.file_name = self.canonize_file(new_file)
+ self.conf = {}
+ self.objects = {}
+ self.config_objects = {}
+ self.objects_read = {}
+
#------------------------------------------------------
def __del__( self ):
"Destruktor"
def search_conf( self, f = None ):
"Sucht die Nagios-Konfigurationsdatei und speichert diese in self.file_name bzw. stirbt, wenn nicht gefunden."
+ self.logger.debug( "Searching for main configuration file ..." )
+
if f is None: f = self.file_name
if os.path.exists(f):
if os.path.isfile(f):
#print repr(search_dirs)
for path in search_dirs:
+ self.logger.debug( "Searching for main configuration file in directory {0!r}.".format( path ) )
if not ( os.path.exists(path) and os.path.isdir(path) ):
continue
if path in used_dirs: continue