2013-02-15 00:44:07 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
#
|
|
|
|
# Munin Plugin for Murmur/ICE
|
|
|
|
# written by T. Fernandez
|
|
|
|
# fixes by Andrew Williams
|
|
|
|
# 07/10/2010
|
|
|
|
#
|
|
|
|
##########################################################
|
|
|
|
|
|
|
|
slicefile = "/usr/share/slice/Murmur.ice"
|
|
|
|
prxstr = "Meta:tcp -h 127.0.0.1 -p 6502"
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
import Ice
|
|
|
|
if not os.path.exists(slicefile):
|
|
|
|
print slicefile+" not found!"
|
|
|
|
quit(1)
|
2013-02-15 00:52:32 +01:00
|
|
|
Ice.loadSlice('', ['-I' + Ice.getSliceDir(), slicefile])
|
2013-02-15 00:44:07 +01:00
|
|
|
|
|
|
|
import Murmur
|
|
|
|
ice = Ice.initialize()
|
|
|
|
prx = ice.stringToProxy(prxstr)
|
|
|
|
murmur = Murmur.MetaPrx.checkedCast(prx)
|
|
|
|
|
|
|
|
if (sys.argv.__len__() == 2) and (sys.argv[1] == "config"):
|
|
|
|
print "graph_title Mumble users"
|
2017-02-23 18:54:28 +01:00
|
|
|
print "graph_category voip"
|
2013-02-15 00:44:07 +01:00
|
|
|
print "graph_vlabel users"
|
|
|
|
print "graph_args --lower-limit 0"
|
|
|
|
for server in murmur.getAllServers():
|
|
|
|
id = str(server.id())
|
|
|
|
print "murmur"+id+".label Server "+id
|
|
|
|
else:
|
|
|
|
for server in murmur.getAllServers():
|
|
|
|
id = str(server.id())
|
|
|
|
if server.isRunning():
|
|
|
|
users = server.getUsers()
|
|
|
|
else:
|
|
|
|
users = []
|
|
|
|
print "murmur"+id+".value "+str(users.__len__())
|
|
|
|
quit(0)
|