Browse Source

Only call the unreachable hook on a state change.

Joe Clarke 10 months ago
parent
commit
aaac05e62f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      www/swreg/pinger.php

+ 3 - 1
www/swreg/pinger.php

@@ -75,7 +75,9 @@ while ($sth !== null && $row = $sth->fetch()) {
     } else {
         if ($row['status'] == REACHABILITY_REACHABLE || $row['status'] == REACHABILITY_NOW_UNREACHABLE) {
             $status = REACHABILITY_NOW_UNREACHABLE;
-            call_hook("PINGER:UNREACHABLE", array($row['serial_number'], $row['ip_address']));
+            if ($row['status'] == REACHABILITY_REACHABLE) {
+                call_hook("PINGER:UNREACHABLE", array($row['serial_number'], $row['ip_address']));
+            }
         }
     }