[wiki/autostatus] compat nouveau monit

Ignore-this: 1c2a7f315c3150bd715c6a90c580010
Les nouvelles versions de monit (sur thot, sur wheezy par ex) mettent
des majuscules aux statuts des services monitorés.

darcs-hash:20121213130732-28565-61289f1c0988709e05ab779e3441cfa8e205ed3d.gz
This commit is contained in:
Daniel STAN 2012-12-13 14:07:32 +01:00
parent dfcda07054
commit 874f61d9cc

View file

@ -93,7 +93,7 @@ def AllStatusOff () :
for s in status[h][t].keys() :
# on supprime un status s'il est Up
if status[h][t][s]['status'] in ['running','accessible'] :
if status[h][t][s]['status'].lower() in ['running','accessible'] :
status[h][t].pop(s)
# reste-t-il des services dans le groupe
@ -126,7 +126,7 @@ def FormatService(Type, Service, Data, f) :
result += f.text(Service)
result += f.strong(0)
result += f.table_cell(0)
if Data['status'] in ['running','accessible'] :
if Data['status'].lower() in ['running','accessible'] :
result += f.table_cell(1,{'style':'background-color:lime'})
else :
result += f.table_cell(1,{'style':'background-color:red'})
@ -264,7 +264,7 @@ def execute(macro, filtre) :
# création de la chaine de retour
code = f.table_cell(0)
if s['status'] in ['running','accessible'] :
if s['status'].lower() in ['running','accessible'] :
code += f.table_cell(1,{'style':'background-color:lime'})
else :
code += f.table_cell(1,{'style':'background-color:red'})