From 32f9909e6d90c9e1082a414a082b9aa71182d5e3 Mon Sep 17 00:00:00 2001 From: Lasse Karstensen Date: Wed, 2 May 2012 00:50:49 +0200 Subject: [PATCH] Add plugins that fail on the node. --- tools/munin-node-from-hell/basic.conf | 2 +- .../munin-node-from-hell/muninnode-from-hell | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/tools/munin-node-from-hell/basic.conf b/tools/munin-node-from-hell/basic.conf index 985a11d0..38811187 100644 --- a/tools/munin-node-from-hell/basic.conf +++ b/tools/munin-node-from-hell/basic.conf @@ -8,7 +8,7 @@ pluginprofile = basic port = 4001 [pluginprofile:basic] -plugins = graph_area +plugins = graph_area, failing_plugin, failing_plugin2, failing_plugin3 [base] # when building an example config with --muninconf, what hostname to output. diff --git a/tools/munin-node-from-hell/muninnode-from-hell b/tools/munin-node-from-hell/muninnode-from-hell index e58c2816..03a5af82 100755 --- a/tools/munin-node-from-hell/muninnode-from-hell +++ b/tools/munin-node-from-hell/muninnode-from-hell @@ -110,6 +110,38 @@ class always_critical(always_warning): return self.conftext.replace("LEVEL","critical") modules["always_critical"] = always_critical() +class failing_plugin(MuninPlugin): + "A really broken plugin" + def fetch(self, conf): + return "# Bad exit" + + def config(self, conf): + return "# Bad exit" +modules["failing_plugin"] = failing_plugin() + +class failing_plugin2(MuninPlugin): + def fetch(self, conf): + return "# Bad exit" + + def config(self, conf): + return """graph_title Config works, fetch fails +graph_vlabel Level +graph_category failing +generic.label generic_label_here +generic.info never_really_used""" +modules["failing_plugin2"] = failing_plugin2() + +class failing_plugin3(MuninPlugin): + def config(self, conf): + return """graph_title A plugin with two dses but only fetch value for one +graph_args --base 1000 -l 0 +fivemin.label 1 minute load +onemin.label 5 minute load""" + def fetch(self, conf): + return "onemin.value 1" +modules["failing_plugin3"] = failing_plugin3() + + class graph_area(MuninPlugin): "A plugin that uses STACK and AREA. From proc_pri. Use: testing the grapher" def fetch(self, conf):