Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/charleszlu/murmur-info.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatenom <natenom@natenom.name>2012-09-05 16:18:39 +0400
committerNatenom <natenom@natenom.name>2012-09-05 16:18:39 +0400
commitd8cfa1f97fc3b87b5a2cd1411671eac298d1d482 (patch)
tree25ae1b56fac62fc98c445c88e479203fd860ffd3
parentf60dbc7caaecb95a84bb1543bb6adc8e2a3e399b (diff)
Moved murmur-munin.py to this repo
-rw-r--r--README8
-rw-r--r--murmur-munin.py61
2 files changed, 66 insertions, 3 deletions
diff --git a/README b/README
index 0854e69..e79b80f 100644
--- a/README
+++ b/README
@@ -1,8 +1,7 @@
======Munin-Plugins======
Several plugins for munin; mostly bash scripts.
-=====Minecraft=====
-Name: minecraft_
+=====minecraft_=====
Description: Shows user count and RAM usage.
Website: http://wiki.natenom.name/minecraft/munin-plugin
@@ -16,6 +15,9 @@ If your server is running on the default port, do:
# cd /etc/munin/plugins
# ln -s /path/to/minecraft_ minecraft_25565
+=====murmur-munin.py=====
+Description: Munin plugin to query murmur (Mumble-Server)
+Website: http://wiki.natenom.name/mumble/tools/munin
-
+ * Has support to set messagesizemax value
diff --git a/murmur-munin.py b/murmur-munin.py
new file mode 100644
index 0000000..702966c
--- /dev/null
+++ b/murmur-munin.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# -*- coding: utf-8
+#
+# munin-murmur.py - "murmur stats (User/Bans/Uptime/Channels)" script for munin.
+# Copyright (c) 2012, Natenom / natenom@natenom.name
+
+#Path to Murmur.ice
+iceslice='/usr/share/Ice/slice/Murmur.ice'
+
+#Murmur-Port (not needed to work, only for display purposes)
+serverport=64738
+
+#Port where ice listen
+iceport=6502
+
+#MessageSizeMax; increase this value, if you get a MemoryLimitException.
+# Also check this value in murmur.ini of your Mumble-Server.
+# This value is being interpreted in kibiBytes.
+messagesizemax="65535"
+
+import Ice, sys
+Ice.loadSlice("--all -I/usr/share/Ice/slice %s" % iceslice)
+
+props = Ice.createProperties([])
+props.setProperty("Ice.MessageSizeMax", str(messagesizemax))
+id = Ice.InitializationData()
+id.properties = props
+
+ice = Ice.initialize(id)
+
+import Murmur
+
+if (sys.argv[1:]):
+ if (sys.argv[1] == "config"):
+ print 'graph_title Murmur (Port %s)' % (serverport)
+ print 'graph_vlabel Count'
+ print 'users.label Users (All)'
+ print 'usersnotauth.label Users (Not authenticated)'
+ print 'uptime.label Uptime in days'
+ print 'chancount.label Channelcount/10'
+ print 'bancount.label Bans on server'
+ sys.exit(0)
+
+
+meta = Murmur.MetaPrx.checkedCast(ice.stringToProxy("Meta:tcp -h 127.0.0.1 -p %s" % (iceport)))
+server=meta.getServer(1)
+
+#count users
+usersnotauth=0
+users=server.getUsers()
+for key in users.keys():
+ if (users[key].userid == -1):
+ usersnotauth+=1
+
+print "users.value %i" % (len(users))
+print "uptime.value %.2f" % (float(meta.getUptime())/60/60/24)
+print "chancount.value %.1f" % (len(server.getChannels())/10)
+print "bancount.value %i" % (len(server.getBans()))
+print "usersnotauth.value %i" % (usersnotauth)
+
+ice.shutdown()