From 3a907a40c862cc17d79a1d8b8b02098816dd0e28 Mon Sep 17 00:00:00 2001 From: chove Date: Fri, 7 Oct 2005 00:54:58 +0200 Subject: [PATCH] on ajoute les infos de la machine (celles disponible sur la page complete) darcs-hash:20051006225458-4ec08-3f295fe6d8bce820d63bfbd68c50862c9cad1a7d.gz --- wiki/macro/HostStatus.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wiki/macro/HostStatus.py b/wiki/macro/HostStatus.py index 548e665f..95f028b7 100644 --- a/wiki/macro/HostStatus.py +++ b/wiki/macro/HostStatus.py @@ -1,6 +1,6 @@ # -*- coding: iso-8859-1 -*- -from commands import getstatusoutput +from commands import getstatusoutput,getoutput def Cellule(texte, couleur, f) : """ @@ -23,7 +23,7 @@ def execute(macro, text) : return Cellule('Impossible d\'analyser le fichier de status.','yellow',macro.formatter) if not status[1].strip() : - return Cellule('Toutes les machines sont up, Vince est de bonne humeur.','lime',macro.formatter) + return Cellule('Toutes les machines (non down) sont up.','lime',macro.formatter) lines = status[1].split('\n') @@ -35,7 +35,7 @@ def execute(macro, text) : line = line.split(' ') code += f.table_row(1) code += f.table_cell(1,{'style':'background-color:silver'}) - code += f.text(line [0]) + code += f.text('%s (%s)' % (line [0], getoutput("grep '%s' /etc/autostatus/hosts | cut -d ' ' -f 5-" % line [0])) ) code += f.table_cell(0) # nombre de non réponse au ping if int(line[1]) > 2 : @@ -43,7 +43,7 @@ def execute(macro, text) : code += f.text('down') else : code += f.table_cell(1,{'style':'background-color:blue'}) - code += f.text('up') + code += f.text('état incertain') code += f.table_cell(0) code += f.table_row(0)