notify user when sth wrong in update()
paulfantom committed
Jun 12, 2016 at 14:34 UTC
122260e7af1aaca35038198f5fdc7003802a835e
1 file changed
+3
-3
plugins.d/python.d.plugin
+3
-3
@@ -128,7 +128,7 @@ class PythonCharts(object):
128
mod.__name__ +
129
".conf' not found. Using defaults.")
130
elif reason[:11] == "misbehaving":
131
- debug(mod.__name__, "is misbeaving. Disabling it")
131
+ debug(mod.__name__, "is "+reason)
132
133
def check(self):
134
for mod in self.modules:
@@ -178,8 +178,8 @@ class PythonCharts(object):
178
except AttributeError:
179
self.disable_module(mod, "no update")
180
return
181
- except (UnboundLocalError, Exception):
182
- self.disable_module(mod, "misbehaving")
181
+ except (UnboundLocalError, Exception) as e:
182
+ self.disable_module(mod, "misbehaving. Reason: " + str(e))
183
return
184
t_end = time.time()
185
self.timetable[mod.__name__]['next'] = t_end - (t_end % self.timetable[mod.__name__]['freq']) + self.timetable[mod.__name__]['freq']