} else { $o_qry.=" AND 0"; } $long_delay_limit=1*60; //1 minute delay (sleeped ?) $tm=getObject("ThisComputer")->getProperty("checked"); // should be taken from database instead if (!$tm) { $tm=time(); } $start_time=time(); include_once(DIR_MODULES.'rss_channels/rss_channels.class.php'); $rss_ch=new rss_channels(); include_once(DIR_MODULES.'pinghosts/pinghosts.class.php'); $pinghosts=new pinghosts(); include_once(DIR_MODULES.'webvars/webvars.class.php'); $webvars=new webvars(); include_once(DIR_MODULES.'watchfolders/watchfolders.class.php'); $watchfolders=new watchfolders(); if (defined('ONEWIRE_SERVER')) { include_once(DIR_MODULES.'onewire/onewire.class.php'); $onw=new onewire(); }
<?php chdir(dirname(__FILE__) . '/../'); include_once "./config.php"; include_once "./lib/loader.php"; include_once "./lib/threads.php"; set_time_limit(0); // connecting to database $db = new mysql(DB_HOST, '', DB_USER, DB_PASSWORD, DB_NAME); include_once "./load_settings.php"; include_once DIR_MODULES . "control_modules/control_modules.class.php"; $ctl = new control_modules(); include_once DIR_MODULES . 'pinghosts/pinghosts.class.php'; $pinghosts = new pinghosts(); $checked_time = 0; echo date("H:i:s") . " running " . basename(__FILE__) . PHP_EOL; while (1) { if (time() - $checked_time > 10) { $checked_time = time(); setGlobal(str_replace('.php', '', basename(__FILE__)) . 'Run', time(), 1); // checking all hosts $pinghosts->checkAllHosts(1); } if (file_exists('./reboot') || $_GET['onetime']) { $db->Disconnect(); exit; } sleep(1); } DebMes("Unexpected close of cycle: " . basename(__FILE__));