2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Add UTF8 plugins

This commit is contained in:
Lasse Karstensen 2012-02-09 14:47:17 +01:00
parent b3ef4781a7
commit 352a9baf94

View File

@ -1,4 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
# .- coding: utf-8 -.
# #
# Artificial munin node that behaves in all the ways you would like # Artificial munin node that behaves in all the ways you would like
# ordinary nodes _not_ to behave. # 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() 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): class ArgumentTCPserver(SocketServer.ThreadingTCPServer):
def __init__(self, server_address, RequestHandlerClass, args): def __init__(self, server_address, RequestHandlerClass, args):