scripts/munin/wiki_themes
Nicolas Dandrimont 7e1a4bb1fe [munin/wiki_*] Le wiki n'est plus sur rouge
Ignore-this: 90eda6d1c9f5a747116287bcd9dcb7c6

darcs-hash:20090328153342-ffbb2-2aab6e3dfbd38991b208695a3fdbe74317a44e44.gz
2009-03-28 16:33:42 +01:00

37 lines
1.1 KiB
Python

#!/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.wiki'
print 'graph_category wiki'
print 'graph_title Themes wiki utilises'
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)