scripts/munin/wiki_themes
Antoine Durand-Gasselin cee435c7ad kikoololisation de munin
(on rajoute des accents partout :)

darcs-hash:20081004175702-bd074-cf32f0e641d84d78ea6a7a8d3a2ed5902ca514b4.gz
2008-10-04 19:57:02 +02:00

37 lines
1.1 KiB
Python
Executable file

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Thèmes wiki utilisés
import sys, commands
THEMES = commands.getoutput("grep -i ^theme_name /var/local/wiki/data/user/* | awk -F '=' '{print $2}' | sort | uniq -c").split('\n')
try :
arg = sys.argv[1]
except :
arg = ''
if arg == "config" :
print 'host_name web.rouge'
print 'graph_category wiki'
print u'graph_title Thèmes wiki utilisés'
print 'graph_scale no'
print "graph_vlabel nb d'utilisateurs"
for theme in THEMES :
nom = theme.strip().split(' ')[1]
for char in [' ','_','-','/','\\',':',';','.','<','>'] :
nom = nom.replace(char, '')
print '%s.label %s' % (nom, theme.strip().split(' ')[1])
if THEMES.index(theme) == 0 :
print '%s.draw AREA' % nom
else :
print '%s.draw STACK' % nom
else :
for theme in THEMES :
nom = theme.strip().split(' ')[1]
nb = theme.strip().split(' ')[0]
for char in [' ','_','-','/','\\',':',';','.','<','>'] :
nom = nom.replace(char, '')
print '%s.value %s' % (nom, nb)