swping.php 565 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * Switch ICMP reping to fill dead cache
  4. */
  5. if (ubRouting::get('action') == 'swping') {
  6. $switchRepingProcess = new StarDust('SWPING');
  7. if ($switchRepingProcess->notRunning()) {
  8. $currenttime = time();
  9. $deadSwitches = zb_SwitchesRepingAll();
  10. zb_StorageSet('SWPINGTIME', $currenttime);
  11. //store dead switches log data
  12. if (!empty($deadSwitches)) {
  13. zb_SwitchesDeadLog($currenttime, $deadSwitches);
  14. }
  15. die('OK:SWPING');
  16. } else {
  17. die('SKIP:SWPING_ALREADY_RUNNING');
  18. }
  19. }