X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=policy.py;h=c1f69a51c67afdcf554296661ff56432d3c61456;hb=37c768dbd516a39bd56bc43f9b73b51acdfd9563;hp=11ec4a7e5b74e57ac85c7abbef68ea1ecdcdc4d1;hpb=5772ce036b96297a23f834ea34ce4466ef4d522c;p=monitor.git diff --git a/policy.py b/policy.py index 11ec4a7..c1f69a5 100755 --- a/policy.py +++ b/policy.py @@ -81,12 +81,12 @@ def main(hostnames, sitenames): # if a node is offline and doesn't have a PCU, remind the user that they should have one. - if not nodehist.haspcu and nodehist.status in ['offline', 'down'] and \ - changed_greaterthan(nodehist.last_changed,1.0) and \ - not found_within(recent_actions, 'pcumissing_notice', 7.0): - - sitehist.sendMessage('pcumissing_notice', hostname=host) - print "send message for host %s pcumissing_notice" % host + #if not nodehist.haspcu and nodehist.status in ['offline', 'down'] and \ + # changed_greaterthan(nodehist.last_changed,1.0) and \ + # not found_within(recent_actions, 'pcumissing_notice', 7.0): + # + # sitehist.sendMessage('pcumissing_notice', hostname=host) + # print "send message for host %s pcumissing_notice" % host # if it is offline and HAS a PCU, then try to use it. if nodehist.haspcu and nodehist.status in ['offline', 'down'] and \ @@ -151,7 +151,7 @@ def main(hostnames, sitenames): # TODO: catch errors sitehist.increasePenalty() - #sitehist.applyPenalty() + sitehist.applyPenalty() sitehist.sendMessage('increase_penalty') print "send message for site %s penalty increase" % site @@ -164,7 +164,7 @@ def main(hostnames, sitenames): # send message that penalties are cleared. sitehist.clearPenalty() - #sitehist.applyPenalty() + sitehist.applyPenalty() sitehist.sendMessage('clear_penalty') sitehist.closeTicket()