kikoololisation de munin
(on rajoute des accents partout :) darcs-hash:20081004175702-bd074-cf32f0e641d84d78ea6a7a8d3a2ed5902ca514b4.gz
This commit is contained in:
parent
ce5e155942
commit
cee435c7ad
8 changed files with 29 additions and 34 deletions
|
@ -12,7 +12,7 @@ except :
|
||||||
|
|
||||||
if arg == "config" :
|
if arg == "config" :
|
||||||
print 'host_name adherents'
|
print 'host_name adherents'
|
||||||
print 'graph_title Adhérents par batiments'
|
print u'graph_title Adhérents par batiments'
|
||||||
print "graph_args --base 1000 --lower-limit 0"
|
print "graph_args --base 1000 --lower-limit 0"
|
||||||
print "graph_vlabel nb d'adhérents"
|
print "graph_vlabel nb d'adhérents"
|
||||||
print 'bata.label Bâtiment A'
|
print 'bata.label Bâtiment A'
|
||||||
|
@ -37,7 +37,7 @@ if arg == "config" :
|
||||||
elif arg == "fichier" :
|
elif arg == "fichier" :
|
||||||
|
|
||||||
file = open('%s.next' % fichier,'w')
|
file = open('%s.next' % fichier,'w')
|
||||||
|
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
from ldap_crans import crans_ldap
|
from ldap_crans import crans_ldap
|
||||||
db = crans_ldap()
|
db = crans_ldap()
|
||||||
|
|
|
@ -7,7 +7,7 @@ sys.path.append("/usr/scripts/gestion")
|
||||||
import hptools
|
import hptools
|
||||||
|
|
||||||
dico_courbes_gen = {
|
dico_courbes_gen = {
|
||||||
'car' : {'titre' : "Etat des cartouches",
|
'car' : {'titre' : u"État des cartouches",
|
||||||
'vlabel' : "nb de pages restantes",
|
'vlabel' : "nb de pages restantes",
|
||||||
'lower-limit' : 0,
|
'lower-limit' : 0,
|
||||||
'upper-limit' : 30000,
|
'upper-limit' : 30000,
|
||||||
|
@ -19,7 +19,7 @@ dico_courbes_gen = {
|
||||||
'car_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.3.0","Cartouche magenta","ff00ff"),
|
'car_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.3.0","Cartouche magenta","ff00ff"),
|
||||||
'car_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.4.0","Cartouche jaune","ffff00")
|
'car_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.4.0","Cartouche jaune","ffff00")
|
||||||
}},
|
}},
|
||||||
'car-p' : {'titre' : "Etat des cartouches",
|
'car-p' : {'titre' : u"État des cartouches (pourcentage)",
|
||||||
'vlabel' : "pourcentage restant",
|
'vlabel' : "pourcentage restant",
|
||||||
'lower-limit' : 0,
|
'lower-limit' : 0,
|
||||||
'upper-limit' : 100,
|
'upper-limit' : 100,
|
||||||
|
@ -29,7 +29,7 @@ dico_courbes_gen = {
|
||||||
'car_p_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.1.1.18.3.0","Cartouche magenta","ff00ff"),
|
'car_p_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.1.1.18.3.0","Cartouche magenta","ff00ff"),
|
||||||
'car_p_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.1.1.18.4.0","Cartouche jaune","ffff00")
|
'car_p_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.1.1.18.4.0","Cartouche jaune","ffff00")
|
||||||
}},
|
}},
|
||||||
'tam' : {'titre' : "Etat des tambours",
|
'tam' : {'titre' : u"État des tambours",
|
||||||
'vlabel' : "nb de pages restantes",
|
'vlabel' : "nb de pages restantes",
|
||||||
'lower-limit' : 0,
|
'lower-limit' : 0,
|
||||||
'upper-limit' : 40000,
|
'upper-limit' : 40000,
|
||||||
|
@ -41,7 +41,7 @@ dico_courbes_gen = {
|
||||||
'tam_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.7.0","Tambour d'imagerie magenta","ff00ff"),
|
'tam_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.7.0","Tambour d'imagerie magenta","ff00ff"),
|
||||||
'tam_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.8.0","Tambour d'imagerie jaune","ffff00"),
|
'tam_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.8.0","Tambour d'imagerie jaune","ffff00"),
|
||||||
}},
|
}},
|
||||||
'tam-p' : {'titre' : "Etat des tambours",
|
'tam-p' : {'titre' : u"État des tambours (pourcentage)",
|
||||||
'vlabel' : "Pourcentage restant",
|
'vlabel' : "Pourcentage restant",
|
||||||
'lower-limit' : 0,
|
'lower-limit' : 0,
|
||||||
'upper-limit' : 100,
|
'upper-limit' : 100,
|
||||||
|
@ -65,7 +65,7 @@ dico_courbes_gen = {
|
||||||
'tray1' : ("1.3.6.1.2.1.43.8.2.1.10.1.1","Transparents","ffff33"),
|
'tray1' : ("1.3.6.1.2.1.43.8.2.1.10.1.1","Transparents","ffff33"),
|
||||||
'tray1_max' : ("1.3.6.1.2.1.43.8.2.1.9.1.1","Transparents (max)","cccc00"),
|
'tray1_max' : ("1.3.6.1.2.1.43.8.2.1.9.1.1","Transparents (max)","cccc00"),
|
||||||
}},
|
}},
|
||||||
'stock-papier-p' : {'titre' : "Stock papier",
|
'stock-papier-p' : {'titre' : "Stock papier (pourcentage)",
|
||||||
'vlabel' : "Pourcentage restant",
|
'vlabel' : "Pourcentage restant",
|
||||||
'lower-limit' : 0,
|
'lower-limit' : 0,
|
||||||
'upper-limit' : 100,
|
'upper-limit' : 100,
|
||||||
|
@ -81,7 +81,7 @@ dico_courbes_gen = {
|
||||||
'tray2' : "1.3.6.1.2.1.43.8.2.1.9.1.2",
|
'tray2' : "1.3.6.1.2.1.43.8.2.1.9.1.2",
|
||||||
'tray1' : "1.3.6.1.2.1.43.8.2.1.9.1.1",
|
'tray1' : "1.3.6.1.2.1.43.8.2.1.9.1.1",
|
||||||
}},
|
}},
|
||||||
'kit' : {'titre' : "Etat des kits images",
|
'kit' : {'titre' : u"État des kits images",
|
||||||
'vlabel' : "nb de pages restantes",
|
'vlabel' : "nb de pages restantes",
|
||||||
'lower-limit' : 0,
|
'lower-limit' : 0,
|
||||||
'upper-limit' : 150000,
|
'upper-limit' : 150000,
|
||||||
|
|
|
@ -44,7 +44,6 @@ def etat():
|
||||||
if diff == None:
|
if diff == None:
|
||||||
diff = 4
|
diff = 4
|
||||||
total += diff
|
total += diff
|
||||||
|
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
total += 24
|
total += 24
|
||||||
return total
|
return total
|
||||||
|
@ -56,15 +55,15 @@ else:
|
||||||
|
|
||||||
if arg == "config":
|
if arg == "config":
|
||||||
# Ecrit sur la sortie standard la configuration
|
# Ecrit sur la sortie standard la configuration
|
||||||
print 'host_name laserjet'
|
print u'host_name laserjet'
|
||||||
print "graph_category etat"
|
print u"graph_category État"
|
||||||
print "graph_args --lower-limit 0 --upper-limit 10"
|
print u"graph_args --lower-limit 0 --upper-limit 10"
|
||||||
print "graph_title Etat de l'imprimante"
|
print u"graph_title État de l'imprimante"
|
||||||
print "graph_vlabel nb"
|
print u"graph_vlabel nb"
|
||||||
print "etat.label Estimation des embrouilles (>3=problemes)"
|
print u"etat.label Estimation des embrouilles (>3=problemes)"
|
||||||
print "etat.warning 4"
|
print u"etat.warning 4"
|
||||||
print "etat.critical 8"
|
print u"etat.critical 8"
|
||||||
print "lpq.label Taille de la file d'attente"
|
print u"lpq.label Taille de la file d'attente"
|
||||||
else:
|
else:
|
||||||
# Ecrit les valeurs actuelles sur la sortie standard
|
# Ecrit les valeurs actuelles sur la sortie standard
|
||||||
print "etat.value %s" % etat()
|
print "etat.value %s" % etat()
|
||||||
|
|
|
@ -11,14 +11,14 @@ if len(sys.argv) > 1:
|
||||||
arg = sys.argv[1]
|
arg = sys.argv[1]
|
||||||
else:
|
else:
|
||||||
arg = ''
|
arg = ''
|
||||||
|
|
||||||
if arg == "config":
|
if arg == "config":
|
||||||
# Ecrit sur la sortie standard la configuration
|
# Ecrit sur la sortie standard la configuration
|
||||||
print 'host_name laserjet'
|
print u'host_name laserjet'
|
||||||
print "graph_category etat"
|
print u"graph_category État"
|
||||||
print "graph_title Pages imprimees"
|
print u"graph_title Pages imprimées"
|
||||||
print "graph_vlabel nb"
|
print u"graph_vlabel nb"
|
||||||
print "total.label Total"
|
print u"total.label Total"
|
||||||
else:
|
else:
|
||||||
# Ecrit les valeurs actuelles sur la sortie standard
|
# Ecrit les valeurs actuelles sur la sortie standard
|
||||||
oid = "1.3.6.1.2.1.43.10.2.1.4.1.1"
|
oid = "1.3.6.1.2.1.43.10.2.1.4.1.1"
|
||||||
|
|
|
@ -26,15 +26,11 @@ if arg == "config" :
|
||||||
print 'orphelines.draw AREA'
|
print 'orphelines.draw AREA'
|
||||||
|
|
||||||
elif arg == "fichier" :
|
elif arg == "fichier" :
|
||||||
|
|
||||||
request = RequestCLI(u"wiki.crans.org/")
|
request = RequestCLI(u"wiki.crans.org/")
|
||||||
request.form = request.args = request.setup_args()
|
request.form = request.args = request.setup_args()
|
||||||
|
|
||||||
_ = request.getText
|
_ = request.getText
|
||||||
|
|
||||||
#if request.mode_getpagelinks: # prevent recursion
|
#if request.mode_getpagelinks: # prevent recursion
|
||||||
#return ''
|
#return ''
|
||||||
|
|
||||||
# find root page.
|
# find root page.
|
||||||
#from MoinMoin.Page import Page
|
#from MoinMoin.Page import Page
|
||||||
#rootpage = Page(request, u"FrontPage", is_rootpage=1)
|
#rootpage = Page(request, u"FrontPage", is_rootpage=1)
|
||||||
|
@ -48,14 +44,14 @@ elif arg == "fichier" :
|
||||||
for link in links:
|
for link in links:
|
||||||
if link in orphaned:
|
if link in orphaned:
|
||||||
del orphaned[link]
|
del orphaned[link]
|
||||||
|
|
||||||
fichier_temp = tempfile.mktemp()
|
fichier_temp = tempfile.mktemp()
|
||||||
file = open('%s' % fichier_temp,'w')
|
file = open('%s' % fichier_temp,'w')
|
||||||
|
|
||||||
file.write("total.value %d\n" % pages.__len__())
|
file.write("total.value %d\n" % pages.__len__())
|
||||||
file.write("orphelines.value %d\n" % orphaned.__len__())
|
file.write("orphelines.value %d\n" % orphaned.__len__())
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
os.system('mv %s %s' % (fichier_temp, fichier))
|
os.system('mv %s %s' % (fichier_temp, fichier))
|
||||||
else :
|
else :
|
||||||
os.system('cat %s' % fichier)
|
os.system('cat %s' % fichier)
|
||||||
|
|
|
@ -11,11 +11,11 @@ try :
|
||||||
arg = sys.argv[1]
|
arg = sys.argv[1]
|
||||||
except :
|
except :
|
||||||
arg = ''
|
arg = ''
|
||||||
|
|
||||||
if arg == "config" :
|
if arg == "config" :
|
||||||
print 'host_name web.rouge'
|
print 'host_name web.rouge'
|
||||||
print 'graph_category wiki'
|
print 'graph_category wiki'
|
||||||
print 'graph_title Thèmes wiki utilisés'
|
print u'graph_title Thèmes wiki utilisés'
|
||||||
print 'graph_scale no'
|
print 'graph_scale no'
|
||||||
print "graph_vlabel nb d'utilisateurs"
|
print "graph_vlabel nb d'utilisateurs"
|
||||||
for theme in THEMES :
|
for theme in THEMES :
|
||||||
|
@ -35,4 +35,3 @@ else :
|
||||||
for char in [' ','_','-','/','\\',':',';','.','<','>'] :
|
for char in [' ','_','-','/','\\',':',';','.','<','>'] :
|
||||||
nom = nom.replace(char, '')
|
nom = nom.replace(char, '')
|
||||||
print '%s.value %s' % (nom, nb)
|
print '%s.value %s' % (nom, nb)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ if [ "$1" = "config" ]; then
|
||||||
echo 'graph_title Utilisateurs wiki'
|
echo 'graph_title Utilisateurs wiki'
|
||||||
echo 'graph_args --base 1000 --lower-limit 0'
|
echo 'graph_args --base 1000 --lower-limit 0'
|
||||||
echo "graph_vlabel nombre d'utilisateurs"
|
echo "graph_vlabel nombre d'utilisateurs"
|
||||||
echo 'enregistres.label Nb enregistrés'
|
echo u'enregistres.label Nb enregistrés'
|
||||||
echo 'enregistres.draw AREA'
|
echo 'enregistres.draw AREA'
|
||||||
echo 'favoris.label Nb avec favoris'
|
echo 'favoris.label Nb avec favoris'
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -118,6 +118,7 @@ class ThemeCrans(ThemeBase):
|
||||||
return classic_head + open_search_desc + wiki_rel
|
return classic_head + open_search_desc + wiki_rel
|
||||||
|
|
||||||
def headscript(self, d):
|
def headscript(self, d):
|
||||||
|
html = []
|
||||||
# Check mode
|
# Check mode
|
||||||
if d.get('print_mode'):
|
if d.get('print_mode'):
|
||||||
link = ""
|
link = ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue