static function addOneWatchdog($pserver, $service, $port, $command) { $v = new watchdog(null, $pserver, "{$service}___{$pserver}"); $v->get(); if ($v->dbaction !== 'add') { dprint("{$service} {$pserver} already exists...\n"); return; } $v->servicename = $service; $v->port = $port; $v->action = $command; $v->status = "on"; $v->added_by_system = "on"; $v->syncserver = $pserver; $v->parent_clname = createClName('pserver', $pserver); $v->dbaction = 'add'; $v->createExtraVariables(); $v->was(); }
function scavenge_main() { global $gbl, $sgbl, $login, $ghtml; log_scavenge("Fix log dir"); passthru("{$sgbl->__path_php_path} ../bin/common/fixlogdir.php"); log_scavenge("### Starting Scavenge"); initProgramlib('admin'); uploadStatsLxCenter(); if (lxfile_exists("../etc/conf/scavenge_time.conf")) { log_scavenge("Found scavenge_time.conf"); } log_scavenge("Collect Traffic"); passthru("{$sgbl->__path_php_path} ../bin/gettraffic.php"); log_scavenge("Collect Quota"); passthru("{$sgbl->__path_php_path} ../bin/collectquota.php"); log_scavenge("Schedule backups"); passthru("{$sgbl->__path_php_path} ../bin/common/schedulebackup.php"); log_scavenge("Clear Sessions"); passthru("{$sgbl->__path_php_path} ../bin/common/clearsession.php"); log_scavenge("Self backup"); passthru("{$sgbl->__path_php_path} ../bin/common/mebackup.php"); log_scavenge("Check Cluster Disk Quota"); checkClusterDiskQuota(); $driverapp = $gbl->getSyncClass(null, 'localhost', 'web'); if ($driverapp === 'lighttpd') { log_scavenge("Restarting lighttpd"); system("service lighttpd restart"); } log_scavenge("InstallApp update"); passthru("{$sgbl->__path_php_path} ../bin/installapp-update.phps"); log_scavenge("Watchdog checks"); $rs = get_all_pserver(); foreach ($rs as $r) { watchdog::addDefaultWatchdog($r); } log_scavenge("Collect LxGuard info"); lxguard::collect_lxguard(); log_scavenge("Fix MySQL root password"); fix_all_mysql_root_password(); log_scavenge("Auto update Kloxo"); auto_update(); log_scavenge("### End Scavenge"); // Wait at least 60 seconds before ending the scavenge sleep(60); }
function scavenge_main() { global $gbl, $sgbl, $login, $ghtml; log_shell("Scavenge: Start"); initProgramlib('admin'); log_shell("Scavenge: Collect Traffic"); passthru("{$sgbl->__path_php_path} ../bin/gettraffic.php"); log_shell("Scavenge: Collect Quota"); passthru("{$sgbl->__path_php_path} ../bin/collectquota.php"); log_shell("Scavenge: Schedule backups"); passthru("{$sgbl->__path_php_path} ../bin/common/schedulebackup.php"); log_shell("Scavenge: Clear Sessions"); passthru("{$sgbl->__path_php_path} ../bin/common/clearsession.php"); log_shell("Scavenge: Self backup"); passthru("{$sgbl->__path_php_path} ../bin/common/mebackup.php"); log_shell("Scavenge: Check Cluster Disk Quota"); checkClusterDiskQuota(); $driverapp = $gbl->getSyncClass(null, 'localhost', 'web'); if ($driverapp === 'lighttpd') { log_shell("Scavenge: Restarting lighttpd"); system("service lighttpd restart"); } log_shell("Scavenge: Fix log dir"); passthru("{$sgbl->__path_php_path} ../bin/common/fixlogdir.php"); log_shell("Scavenge: InstallApp update"); passthru("{$sgbl->__path_php_path} ../bin/installapp-update.phps"); log_shell("Scavenge: Watchdog checks"); $rs = get_all_pserver(); foreach ($rs as $r) { watchdog::addDefaultWatchdog($r); } log_shell("Scavenge: Collect LxGuard info"); lxguard::collect_lxguard(); log_shell("Scavenge: Fix MySQL root password"); fix_all_mysql_root_password(); log_shell("Scavenge: Auto update Kloxo"); auto_update(); }
function setWatchdogDefaults() { global $gbl, $sgbl, $login, $ghtml; log_cleanup("Set Watchdog defaults"); log_cleanup("- Set process"); watchdog::addDefaultWatchdog('localhost'); $a = null; $driverapp = $gbl->getSyncClass(null, 'localhost', 'web'); $a['web'] = $driverapp; $driverapp = $gbl->getSyncClass(null, 'localhost', 'spam'); $a['spam'] = $driverapp; $driverapp = $gbl->getSyncClass(null, 'localhost', 'dns'); $a['dns'] = $driverapp; slave_save_db("driver", $a); }