murmur-munin.py - Support for icesecretread

This commit is contained in:
Natenom 2012-09-06 09:02:00 +02:00
parent d8cfa1f97f
commit 73c444ba54
2 changed files with 14 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*~

View File

@ -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