scripts/munin/wiki_themes
Nicolas Dandrimont 8cadc47bcc Rouge est toujours en iso
darcs-hash:20080914015401-ffbb2-353bf6fd436d0d6b04894d2b69d90f8466c6f4f1.gz
2008-09-14 03:54:01 +02:00

38 lines
1.1 KiB
Python
Executable file

#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
# 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 '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)