From 352a9baf9429ac320613b927e7205f5b747566b4 Mon Sep 17 00:00:00 2001 From: Lasse Karstensen Date: Thu, 9 Feb 2012 14:47:17 +0100 Subject: [PATCH] Add UTF8 plugins --- .../munin-node-from-hell/muninnode-from-hell | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tools/munin-node-from-hell/muninnode-from-hell b/tools/munin-node-from-hell/muninnode-from-hell index 06f0ef60..fabab78b 100755 --- a/tools/munin-node-from-hell/muninnode-from-hell +++ b/tools/munin-node-from-hell/muninnode-from-hell @@ -1,4 +1,5 @@ #!/usr/bin/python +# .- coding: utf-8 -. # # Artificial munin node that behaves in all the ways you would like # ordinary nodes _not_ to behave. @@ -135,6 +136,40 @@ locked.info The number of processes that have pages locked into memory (for real """ modules["graph_area"] = graph_area() +class utf8_graphcat(MuninPlugin): + "A plugin with a graph category which has UTF-8 in it" + def fetch(self, conf): + load = open("/proc/loadavg", "r").read() + load, rest = load.split(" ", 1) + load = float(load) + return "apples.value %.2f" % load + + def config(self, conf): + return """graph_title Example UTF-8 graph +graph_vlabel apples +graph_category foo™ +apples.label apples +graph_info Apples eaten +apples.info Apples eaten""" +modules["utf8_graphcat"] = utf8_graphcat() + +class utf8_graphname(MuninPlugin): + "A plugin with a UTF-8 name" + def fetch(self, conf): + load = open("/proc/loadavg", "r").read() + load, rest = load.split(" ", 1) + load = float(load) + return "apples.value %.2f" % load + + def config(self, conf): + return """graph_title Example UTF-8 graph +graph_vlabel apples +graph_category system +apples.label apples +graph_info Apples eaten +apples.info Apples eaten""" +modules["utf8_™graphname"] = utf8_graphname() + class ArgumentTCPserver(SocketServer.ThreadingTCPServer): def __init__(self, server_address, RequestHandlerClass, args):