Browse Source

Keep alerting as scope increases.

Joe Clarke 1 year ago
parent
commit
cf9907b14e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      automation/services/dhcp_scope_watch.py

+ 3 - 3
automation/services/dhcp_scope_watch.py

@@ -135,12 +135,12 @@ if __name__ == "__main__":
     for scope, stat in metrics.items():
         stats[scope] = {"perc": stat["util"]}
         if stat["util"] >= float(THRESHOLD):
-            curr_state[scope] = True
-            if scope not in prev_state or (scope in prev_state and not prev_state[scope]):
+            curr_state[scope] = stat["util"]
+            if scope not in prev_state or (scope in prev_state and stat["util"] - prev_state[scope] > 1.0):
                 spark.post_to_spark(
                     C.WEBEX_TEAM,
                     SPARK_ROOM,
-                    "Scope **{0}** is now **{1:.2f}%** utilized ({2} of {3} free addresses remain); suppressing future alerts until resolved".format(
+                    "Scope **{0}** is now **{1:.2f}%** utilized ({2} of {3} free addresses remain); suppressing future alerts until resolved or utilization increases".format(
                         scope, stat["util"], stat["free-dynamic"], stat["total-dynamic"]
                     ),
                     MessageType.WARNING,