Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision Les deux révisions suivantes
sysadmin:monitoring:mumble [2011/10/05 15:41]
james [Prérequis] ajout prerequis mumble 1.2.3
sysadmin:monitoring:mumble [2011/10/05 15:45]
james [Activer le plugin dans munin]
Ligne 39: Ligne 39:
 /​etc/​init.d/​munin-node restart</​code>​ /​etc/​init.d/​munin-node restart</​code>​
 Et voila, vous devriez commencer a voir un nouveau graphe dans munin (apres un certain laps de temps tout de même). Et voila, vous devriez commencer a voir un nouveau graphe dans munin (apres un certain laps de temps tout de même).
 +
 +===== Mes modifications sur le plugin =====
 +
 +Ce plugin en l'​état ne me satisfaisait pas, je l'ai donc modifié comme suit pour afficher le nombre de canaux et non pas le nombre de canaux/10 et ajouter la categorie murmur :
 +<​code>​
 +#​!/​usr/​bin/​env python
 +# -*- coding: utf-8
 +# Python Plugin for Munin
 +# Copyright (C) 2010 Natenom (Natenom@googlemail.com)
 +# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later vers
 +ion.
 +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 +# You should have received a copy of the GNU General Public License along with this program; if not, see <​http://​www.gnu.org/​licenses/>​.
 +#Version: 0.0.1
 +#2010-02-09
 +
 +#Path to Murmur.ice
 +iceslice='/​usr/​share/​slice/​Murmur.ice'​
 +
 +#​Murmur-Port (not needed to work, only for display purposes)
 +serverport=64738
 +
 +#Port where ice listen
 +iceport=6502
 +
 +
 +import Ice, sys
 +
 +# pour la compatibilité avec mumble 1.2.3 :
 +#​Ice.loadSlice(iceslice)
 +Ice.loadSlice( '',​ ['​-I'​ + Ice.getSliceDir(),​ iceslice ] )
 +
 +ice = Ice.initialize()
 +import Murmur
 +
 +if (sys.argv[1:​]):​
 +  if (sys.argv[1] == "​config"​):​
 +    print '​graph_title Murmur (Port %s)' % (serverport)
 +    print '​graph_vlabel Count'
 +    print '​graph_category murmurd'​
 +    print '​users.label Users'
 +    print '​uptime.label Uptime in days'
 +    print '​chancount.label Channelcount'​
 +    print '​bancount.label Bans on server'​
 +    sys.exit(0)
 +
 +meta = Murmur.MetaPrx.checkedCast(ice.stringToProxy("​Meta:​tcp -h 127.0.0.1 -p %s" % (iceport)))
 +server=meta.getServer(1)
 +print "​users.value %i" % (len(server.getUsers()))
 +print "​uptime.value %.2f" % (float(meta.getUptime())/​60/​60/​24)
 +print "​chancount.value %.1f" % (len(server.getChannels()))
 +print "​bancount.value %i" % (len(server.getBans()))
 +
 +ice.shutdown()
 +</​code>​
  
sysadmin/monitoring/mumble.txt · Dernière modification: 2014/10/29 18:12 par james
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0