properties and emailTxt
[monitor.git] / policy.py
index 43b37ca..7525c0d 100755 (executable)
--- a/policy.py
+++ b/policy.py
@@ -33,7 +33,7 @@ api = plc.getAuthAPI()
 
 def logic():
 
-       plc.nodeBootState(host, 'rins')
+       plc.nodeBootState(host, 'reinstall')
        node_end_record(host)
 
 def main(hostnames, sitenames):
@@ -67,6 +67,8 @@ def main(hostnames, sitenames):
                        changed_lessthan(nodehist.last_changed, 1.0) and \
                        found_within(recent_actions, 'down_notice', 7.0) and \
                        not found_within(recent_actions, 'online_notice', 0.5):
+                               # NOTE: chronicly flapping nodes will not get 'online' notices
+                               #               since, they are never up long enough to be 'good'.
                            # NOTE: searching for down_notice proves that the node has
                                #               gone through a 'down' state first, rather than just
                                #               flapping through: good, offline, online, ...
@@ -79,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 \