mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00:00
Checks if the virtual server is booted before attempting to read the userlist. Stops weird and wonderful crashes in a non-static setup.
This commit is contained in:
parent
48d91acaf9
commit
fad01c8b91
1 changed files with 42 additions and 38 deletions
|
@ -1,38 +1,42 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
#
|
#
|
||||||
# Munin Plugin for Murmur/ICE
|
# Munin Plugin for Murmur/ICE
|
||||||
# written by T. Fernandez
|
# written by T. Fernandez
|
||||||
# 02/03/2010
|
# fixes by Andrew Williams
|
||||||
#
|
# 07/10/2010
|
||||||
##########################################################
|
#
|
||||||
|
##########################################################
|
||||||
slicefile = "./Murmur.ice"
|
|
||||||
prxstr = "Meta:tcp -h 127.0.0.1 -p 6502"
|
slicefile = "/usr/share/slice/Murmur.ice"
|
||||||
|
prxstr = "Meta:tcp -h 127.0.0.1 -p 6502"
|
||||||
import os
|
|
||||||
import sys
|
import os
|
||||||
|
import sys
|
||||||
import Ice
|
|
||||||
if not os.path.exists(slicefile):
|
import Ice
|
||||||
print slicefile+" not found!"
|
if not os.path.exists(slicefile):
|
||||||
quit(1)
|
print slicefile+" not found!"
|
||||||
Ice.loadSlice(slicefile)
|
quit(1)
|
||||||
|
Ice.loadSlice(slicefile)
|
||||||
import Murmur
|
|
||||||
ice = Ice.initialize()
|
import Murmur
|
||||||
prx = ice.stringToProxy(prxstr)
|
ice = Ice.initialize()
|
||||||
murmur = Murmur.MetaPrx.checkedCast(prx)
|
prx = ice.stringToProxy(prxstr)
|
||||||
|
murmur = Murmur.MetaPrx.checkedCast(prx)
|
||||||
if (sys.argv.__len__() == 2) and (sys.argv[1] == "config"):
|
|
||||||
print "graph_title Mumble users"
|
if (sys.argv.__len__() == 2) and (sys.argv[1] == "config"):
|
||||||
print "graph_vlabel users"
|
print "graph_title Mumble users"
|
||||||
print "graph_args --lower-limit 0"
|
print "graph_vlabel users"
|
||||||
for server in murmur.getAllServers():
|
print "graph_args --lower-limit 0"
|
||||||
id = str(server.id())
|
for server in murmur.getAllServers():
|
||||||
print "murmur"+id+".label Server "+id
|
id = str(server.id())
|
||||||
else:
|
print "murmur"+id+".label Server "+id
|
||||||
for server in murmur.getAllServers():
|
else:
|
||||||
id = str(server.id())
|
for server in murmur.getAllServers():
|
||||||
users = server.getUsers()
|
id = str(server.id())
|
||||||
print "murmur"+id+".value "+str(users.__len__())
|
if server.isRunning():
|
||||||
quit(0)
|
users = server.getUsers()
|
||||||
|
else:
|
||||||
|
users = []
|
||||||
|
print "murmur"+id+".value "+str(users.__len__())
|
||||||
|
quit(0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue