mirror of
https://github.com/cmur2/munin-mumble.git
synced 2025-01-09 19:00:27 +01:00
Add usersauth and refactor labels
This commit is contained in:
parent
cf631a4652
commit
c18aa7f813
16
mumble
16
mumble
@ -45,13 +45,13 @@ if (sys.argv[1:]):
|
|||||||
print 'graph_title Murmur (Port %s)' % (serverport)
|
print 'graph_title Murmur (Port %s)' % (serverport)
|
||||||
print 'graph_vlabel Count'
|
print 'graph_vlabel Count'
|
||||||
print 'users.label Users (All)'
|
print 'users.label Users (All)'
|
||||||
|
print 'usersauth.label Users (Authenticated)'
|
||||||
print 'usersnotauth.label Users (Not authenticated)'
|
print 'usersnotauth.label Users (Not authenticated)'
|
||||||
print 'uptime.label Uptime in days'
|
print 'uptime.label Uptime in days'
|
||||||
print 'chancount.label Channelcount/10'
|
print 'channelcount.label Number of channels'
|
||||||
print 'bancount.label Bans on server'
|
print 'bancount.label Number of bans'
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
meta = Murmur.MetaPrx.checkedCast(ice.stringToProxy("Meta:tcp -h 127.0.0.1 -p %s" % (iceport)))
|
meta = Murmur.MetaPrx.checkedCast(ice.stringToProxy("Meta:tcp -h 127.0.0.1 -p %s" % (iceport)))
|
||||||
try:
|
try:
|
||||||
server = meta.getServer(1)
|
server = meta.getServer(1)
|
||||||
@ -62,15 +62,19 @@ except Murmur.InvalidSecretException:
|
|||||||
|
|
||||||
# count users
|
# count users
|
||||||
usersnotauth = 0
|
usersnotauth = 0
|
||||||
|
usersauth = 0
|
||||||
users = server.getUsers()
|
users = server.getUsers()
|
||||||
for key in users.keys():
|
for key in users.keys():
|
||||||
if (users[key].userid == -1):
|
if (users[key].userid == -1):
|
||||||
usersnotauth += 1
|
usersnotauth += 1
|
||||||
|
else:
|
||||||
|
usersauth += 1
|
||||||
|
|
||||||
print "users.value %i" % (len(users))
|
print "users.value %i" % (len(users))
|
||||||
print "uptime.value %.2f" % (float(meta.getUptime())/60/60/24)
|
print "usersauth.value %i" % (usersauth)
|
||||||
print "chancount.value %.1f" % (len(server.getChannels())/10)
|
|
||||||
print "bancount.value %i" % (len(server.getBans()))
|
|
||||||
print "usersnotauth.value %i" % (usersnotauth)
|
print "usersnotauth.value %i" % (usersnotauth)
|
||||||
|
print "uptime.value %.2f" % (float(meta.getUptime())/60/60/24)
|
||||||
|
print "channelcount.value %i" % (len(server.getChannels()))
|
||||||
|
print "bancount.value %i" % (len(server.getBans()))
|
||||||
|
|
||||||
ice.shutdown()
|
ice.shutdown()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user