X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=policy.py;h=fe54863c8d41a6a4198d378cd232ce7b9eed6ce3;hp=84bdb445a17e40086f1f07ff4f4eca6ea4f149ce;hb=32e64e33bc81735e22024c5a44510848bb3c88df;hpb=28582f7068d5ef8e74cb3b70134f682d4ab471bc diff --git a/policy.py b/policy.py index 84bdb44..fe54863 100755 --- a/policy.py +++ b/policy.py @@ -119,12 +119,17 @@ def main(hostnames, sitenames): # sitehist.sendMessage('retry_bootman', hostname=host) if nodehist.status == 'down' and \ - changed_greaterthan(nodehist.last_changed, 2) and \ - not found_within(recent_actions, 'down_notice', 3.5): - # send down node notice - - sitehist.sendMessage('down_notice', hostname=host) - print "send message for host %s down" % host + changed_greaterthan(nodehist.last_changed, 2): + if not nodehist.firewall and not found_within(recent_actions, 'down_notice', 3.5): + # send down node notice + sitehist.sendMessage('down_notice', hostname=host) + print "send message for host %s down" % host + + if nodehist.firewall and not found_within(recent_actions, 'firewall_notice', 3.5): + # send down node notice + email_exception(host, "firewall_notice") + sitehist.sendMessage('firewall_notice', hostname=host) + print "send message for host %s down" % host node_count = node_count + 1 print "time: ", time.strftime('%Y-%m-%d %H:%M:%S')