5 from monitor import database
9 from HyperText.HTML import A, BR, IMG, TABLE, TR, TH, TD, EM, quote_body
10 from HyperText.Documents import Document
11 print "Content-Type: text/html\r\n"
13 form = cgi.FieldStorage()
19 retvalue = form.getvalue(val)
26 vals['ssh'] = get_value('ssh')
27 vals['state'] = get_value('state')
28 vals['nm'] = get_value('nm')
29 vals['princeton_comon'] = get_value('princeton_comon')
30 vals['princeton_comon_running'] = get_value('princeton_comon_running')
31 vals['princeton_comon_procs'] = get_value('princeton_comon_procs')
35 fb = database.dbLoad("findbad")
37 for mynode in fb['nodes'].keys():
38 fbnode = fb['nodes'][mynode]['values']
42 for key in ['ssh', 'state', 'nm', 'princeton_comon', 'princeton_comon_running', 'princeton_comon_procs']:
46 if vals[key] and vals[key] == fbnode[key]:
53 row.append(fbnode[key])
56 packed_values.append(row)
60 for i in range(1,len(x)):
61 if x[i] == y[i]: continue
62 if x[i] < y[i]: return -1
63 if x[i] > y[i]: return 1
67 packed_values.sort(rowcmp)
71 for value in ['num', 'host', 'ssh', 'state', 'NM', 'comon<br>dir', 'comon<br>vserver', 'comon<br>procs']:
76 for row in packed_values: