X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sitebad.py;h=df4e522da22cbff5b8a1a4395762652670247493;hb=bf02dca4b0f09d86990a50a4406ab8ecd79cbd5d;hp=4d9ee33b45ab9ccdbfcb95ed20862c249c1d0687;hpb=c9d06f3b274ecbc092a0b3eb1f5ceb6c0f734aad;p=monitor.git diff --git a/sitebad.py b/sitebad.py index 4d9ee33..df4e522 100755 --- a/sitebad.py +++ b/sitebad.py @@ -44,6 +44,8 @@ def getnodesup(nodelist): up = 0 for node in nodelist: try: + # NOTE: adding a condition for nodehist.haspcu would include pcus + # in the calculation nodehist = HistoryNodeRecord.findby_or_create(hostname=node['hostname']) nodebl = BlacklistRecord.get_by(hostname=node['hostname']) if (nodehist is not None and nodehist.status != 'down') or \ @@ -51,6 +53,7 @@ def getnodesup(nodelist): up = up + 1 except: import traceback + email_exception(node['hostname']) print traceback.print_exc() return up @@ -107,6 +110,7 @@ def checkAndRecordState(l_sites, l_plcsites): 'penalty_level' : 0}) sitehist.last_checked = datetime.now() + sitehist.plc_siteid = d_site['site_id'] sitehist.slices_total = d_site['max_slices'] sitehist.slices_used = len(d_site['slice_ids']) sitehist.nodes_total = len(lb2hn[sitename])