Browse files

Merge pull request #258 from thomasleveil/munin_users_issue257

[plugin munin_users] issue #257
  • Loading branch information...
2 parents fc63981 + 0074272 commit 7840fc587c28a4aafd97423788ccc702c970c5e3 @kenyon kenyon committed Mar 3, 2013
Showing with 43 additions and 43 deletions.
  1. +42 −42 plugins/other/mumble_users
  2. +1 −1 plugins/other/murmur-stats
View
84 plugins/other/mumble_users
@@ -1,42 +1,42 @@
-#!/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)
-Ice.loadSlice(slicefile)
-
-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"
- 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)
+#!/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)
+Ice.loadSlice('', ['-I' + Ice.getSliceDir(), slicefile])
+
+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"
+ 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)
View
2 plugins/other/murmur-stats
@@ -19,7 +19,7 @@ iceport=6502
import Ice, sys
-Ice.loadSlice(iceslice)
+Ice.loadSlice('', ['-I' + Ice.getSliceDir(), iceslice])
ice = Ice.initialize()
import Murmur

0 comments on commit 7840fc5

Please sign in to comment.