]> arthur.barton.de Git - netdata.git/commitdiff
enable different path for `/sys/devices` in `cpufreq.chart.py`
authorpaulfantom <paulfantom@gmail.com>
Thu, 7 Jul 2016 13:36:19 +0000 (15:36 +0200)
committerpaulfantom <paulfantom@gmail.com>
Thu, 7 Jul 2016 13:36:19 +0000 (15:36 +0200)
conf.d/python.d/cpufreq.conf
python.d/cpufreq.chart.py

index e25910e37d16da465f418813fe41fdbb499796a7..d08c2df7f0efaf9c002d3bc424dcbb8a859175e8 100644 (file)
@@ -2,3 +2,4 @@
 # YAML format
 
 update_every : 2
+sys_dir: "/sys/devices"
index 8677de544b99a5b8cd9f083c3addb70df87c4b98..b7d912dfe0470bb97ea03b6e00bc3ad96dbd90d4 100644 (file)
@@ -41,6 +41,11 @@ class Service(SimpleService):
         return data
 
     def check(self):
+        try:
+            self.sys_dir = str(self.configuration['sys_dir'])
+        except (KeyError, TypeError):
+            self.error("No path to log specified. Using: '" + self.sys_dir + "'")
+
         self._orig_name = self.chart_name
 
         for dirpath, _, filenames in os.walk(self.sys_dir):