From 73c444ba540dc25ce8d24af63468fa595a7536f4 Mon Sep 17 00:00:00 2001 From: Natenom Date: Thu, 6 Sep 2012 09:02:00 +0200 Subject: [PATCH] murmur-munin.py - Support for icesecretread --- .gitignore | 1 + murmur-munin.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/murmur-munin.py b/murmur-munin.py index 702966c..62df9aa 100644 --- a/murmur-munin.py +++ b/murmur-munin.py @@ -13,6 +13,11 @@ serverport=64738 #Port where ice listen iceport=6502 +#Ice Password to get read access. +#If there is no such var in your murmur.ini, this can have any value. +#You can also use the icesecretwrite of your server. +icesecretread="secureme" + #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. @@ -23,10 +28,12 @@ Ice.loadSlice("--all -I/usr/share/Ice/slice %s" % iceslice) props = Ice.createProperties([]) props.setProperty("Ice.MessageSizeMax", str(messagesizemax)) +props.setProperty("Ice.ImplicitContext", "Shared") id = Ice.InitializationData() id.properties = props ice = Ice.initialize(id) +ice.getImplicitContext().put("secret", icesecretread) import Murmur @@ -43,7 +50,12 @@ if (sys.argv[1:]): meta = Murmur.MetaPrx.checkedCast(ice.stringToProxy("Meta:tcp -h 127.0.0.1 -p %s" % (iceport))) -server=meta.getServer(1) +try: + server=meta.getServer(1) +except Murmur.InvalidSecretException: + print 'Given icesecreatread password is wrong.' + ice.shutdown() + sys.exit(1) #count users usersnotauth=0