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

github.com/mumble-voip/mumble-scripts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatenom <natenom@natenom.com>2016-01-05 15:00:42 +0300
committerNatenom <natenom@natenom.com>2016-01-05 15:00:42 +0300
commit8a578cb2ea8ed70ed9e5c7b7685795bc2311fd2f (patch)
tree81f98f76cfb586fd93fb32a70ee89be4793c2a6c
parentf6a171fadcabbbdc1b084ef04a3fbbdbf8201c55 (diff)
add exception for Ice connection; make ice host configurable, code style, encoding version
-rw-r--r--Monitoring/munin-murmur.py40
1 files changed, 25 insertions, 15 deletions
diff --git a/Monitoring/munin-murmur.py b/Monitoring/munin-murmur.py
index 0d494a7..17cf2d9 100644
--- a/Monitoring/munin-murmur.py
+++ b/Monitoring/munin-murmur.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8
#
# munin-murmur.py
-# Copyright (c) 2010 - 2015, Natenom <natenom@natenom.com>
+# Copyright (c) 2010 - 2016, Natenom <natenom@natenom.com>
#
# All rights reserved.
#
@@ -31,7 +31,7 @@
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
+# POSSIBILITY OF SUCH DAMAGE.
# Settings for what to show:
show_users_all = True # All users regardless their state
@@ -51,24 +51,27 @@ show_uptime = True # Uptime of the server (in days)
#Path to Murmur.ice
iceslice = "/usr/share/Ice/slice/Murmur.ice"
-#Includepath for Ice, this is default for Debian
+# Includepath for Ice, this is default for Debian
iceincludepath = "/usr/share/Ice/slice"
-#Murmur-Port (not needed to work, only for display purposes)
-serverport=64738
+# Murmur-Port (not needed to work, only for display purposes)
+serverport = 64738
-#Port where ice listen
-iceport=6502
+# Host of the Ice service; most probably this is 127.0.0.1
+icehost = "127.0.0.1"
-#Ice Password to get read access.
-#If there is no such var in your murmur.ini, this can have any value.
-#You can use the values of icesecret, icesecretread or icesecretwrite in your murmur.ini
-icesecret="secureme"
+# Port where ice listen
+iceport = 6502
-#MessageSizeMax; increase this value, if you get a MemoryLimitException.
+# Ice Password to get read access.
+# If there is no such var in your murmur.ini, this can have any value.
+# You can use the values of icesecret, icesecretread or icesecretwrite in your murmur.ini
+icesecret = "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.
-messagesizemax="65535"
+messagesizemax = "65535"
####################################################################
##### DO NOT TOUCH BELOW THIS LINE UNLESS YOU KNOW WHAT YOU DO #####
@@ -79,6 +82,7 @@ Ice.loadSlice("--all -I%s %s" % (iceincludepath, iceslice))
props = Ice.createProperties([])
props.setProperty("Ice.MessageSizeMax", str(messagesizemax))
props.setProperty("Ice.ImplicitContext", "Shared")
+props.setProperty("Ice.Default.EncodingVersion", "1.0")
id = Ice.InitializationData()
id.properties = props
@@ -116,10 +120,16 @@ if (sys.argv[1:]):
sys.exit(0)
-meta = Murmur.MetaPrx.checkedCast(ice.stringToProxy("Meta:tcp -h 127.0.0.1 -p %s" % (iceport)))
+try:
+ meta = Murmur.MetaPrx.checkedCast(ice.stringToProxy("Meta:tcp -h %s -p %s" % (icehost, iceport)))
+except Ice.ConnectionRefusedException:
+ print 'Could not connect to Murmur via Ice. Please check '
+ ice.shutdown()
+ sys.exit(1)
+
try:
server=meta.getServer(1)
-except Murmur.InvalidSecretException:
+except Murmur.InvalidSecretException:
print 'Given icesecreatread password is wrong.'
ice.shutdown()
sys.exit(1)