]> git.ipfire.org Git - collecty.git/commitdiff
collectyd: Accept -d for debugging mode. Read configuration files.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Aug 2012 18:05:55 +0000 (18:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Aug 2012 18:05:55 +0000 (18:05 +0000)
collectyd

index ae0f6080acaf72d6ba6347965819656a145c7268..a90e5ded4623576d482e87069202e492d5c2eb7a 100755 (executable)
--- a/collectyd
+++ b/collectyd
@@ -26,12 +26,21 @@ import collecty
 
 # Parse command line options.
 op = optparse.OptionParser(usage="usage: %prog [options] <configfile1> ... <configfileN>")
-op.add_option("-d", "--daemon", action="store_true", default=False,
-               help="Run as a daemon in background.")
+op.add_option("-d", "--debug", action="store_true", default=False,
+               help="Enable debug logging.")
 (options, configfiles) = op.parse_args()
 
+# Initialize the settings for this Collecty instance.
+settings = {
+       debug : options.debug,
+}
+
 # Initialize the application.
-c = collecty.Collecty()
+c = collecty.Collecty(**settings)
+
+# Read all configuration files.
+for configfile in configfiles:
+       c.read_config(configfile)
 
 # Run.
 c.run()