]> arthur.barton.de Git - netdata.git/blobdiff - plugins.d/python.d.plugin
fixed a bug that prevented dispatching alarms to multiple email recipients
[netdata.git] / plugins.d / python.d.plugin
index 1301777bee9debbd70108b093a4116297b8d459c..5e81fb263c0489807449b9fdff79a0db0c72a6d7 100755 (executable)
@@ -477,6 +477,8 @@ def run():
     configfile = CONFIG_DIR + "python.d.conf"
     msg.PROGRAM = PROGRAM
     msg.info("reading configuration file:", configfile)
+    log_counter = 200
+    log_interval = 3600
 
     conf = read_config(configfile)
     if conf is not None:
@@ -495,6 +497,14 @@ def run():
             DEBUG_FLAG = conf['debug']
         except (KeyError, TypeError):
             pass
+        try:
+            log_counter = conf['logs_per_interval']
+        except (KeyError, TypeError):
+            pass
+        try:
+            log_interval = conf['log_interval']
+        except (KeyError, TypeError):
+            pass
         for k, v in conf.items():
             if k in ("update_every", "debug", "enabled"):
                 continue
@@ -504,6 +514,8 @@ def run():
     # parse passed command line arguments
     modules = parse_cmdline(MODULES_DIR, *sys.argv)
     msg.DEBUG_FLAG = DEBUG_FLAG
+    msg.LOG_COUNTER = log_counter
+    msg.LOG_INTERVAL = log_interval
     msg.info("MODULES_DIR='" + MODULES_DIR +
              "', CONFIG_DIR='" + CONFIG_DIR +
              "', UPDATE_EVERY=" + str(BASE_CONFIG['update_every']) +