function check() { $EnablePhileSight = GET_INFO_DAEMON("EnablePhileSight"); if ($EnablePhileSight == null) { $EnablePhileSight = 0; } if ($EnablePhileSight == 0) { writelogs("feature disabled, aborting...", __FUNCTION__, __FILE__, __LINE__); die; } if (system_is_overloaded()) { writelogs("System overloaded, aborting this feature for the moment", __FUNCTION__, __FILE__, __LINE__); die; } @mkdir("/opt/artica/philesight"); $unix = new unix(); $min = $unix->file_time_min("/opt/artica/philesight/database.db"); $sock = new sockets(); $rr = $sock->GET_INFO("PhileSizeRefreshEach"); if ($rr == null) { $rr = 120; } if ($rr == "disable") { die; } writelogs("/opt/artica/philesight/database.db = {$min} minutes, {$rr} minutes to run", __FUNCTION__, __FILE__, __LINE__); if ($min >= $rr) { run(); } }
function check() { $unix = new unix(); $MEMORY = $unix->MEM_TOTAL_INSTALLEE(); if ($MEMORY < 624288) { writelogs(basename(__FILE__) . ":Too low memory, die();", basename(__FILE__), __FILE__, __LINE__); die; } if (!is_file("/usr/bin/ruby1.8")) { $unix->DEBIAN_INSTALL_PACKAGE("ruby1.8"); } $EnablePhileSight = GET_INFO_DAEMON("EnablePhileSight"); if ($EnablePhileSight == null) { $EnablePhileSight = 0; } if ($EnablePhileSight == 0) { writelogs("feature disabled, aborting...", __FUNCTION__, __FILE__, __LINE__); die; } if (system_is_overloaded()) { writelogs("System overloaded, aborting this feature for the moment", __FUNCTION__, __FILE__, __LINE__); die; } @mkdir("/opt/artica/philesight"); $unix = new unix(); $min = $unix->file_time_min("/opt/artica/philesight/database.db"); $sock = new sockets(); $rr = $sock->GET_INFO("PhileSizeRefreshEach"); if ($rr == null) { $rr = 120; } if ($rr == "disable") { die; } writelogs("/opt/artica/philesight/database.db = {$min} minutes, {$rr} minutes to run", __FUNCTION__, __FILE__, __LINE__); if ($min >= $rr) { run(); } }
function group10() { if (!is_numeric($GLOBALS["TIME"]["GROUP10"])) { $GLOBALS["TIME"]["GROUP10"] = time(); return; } if ($GLOBALS["TIME"]["GROUP10"] == 0) { $GLOBALS["TIME"]["GROUP10"] = time(); return; } $mins = calc_time_min($GLOBALS["TIME"]["GROUP10"]); if ($mins < 10) { return; } events("Starting {$mins} (minutes) {$GLOBALS["TIME"]["GROUP10"]} " . time(), __FUNCTION__, __LINE__); $GLOBALS["TIME"]["GROUP10"] = time(); events("Starting {$GLOBALS["GROUP10"]}", __FUNCTION__, __LINE__); $EnablePhileSight = GET_INFO_DAEMON("EnablePhileSight"); if ($EnablePhileSight == null) { $EnablePhileSight = 1; } $array[] = "exec.getent.php"; $array[] = "exec.clean.logs.php --clean-tmp"; if ($GLOBALS["OCS_INSTALLED"]) { $array[] = "exec.ocsweb.php --injection"; } if ($GLOBALS["AUDITD_INSTALLED"]) { $array[] = "exec.auditd.php --import"; } if ($GLOBALS["SQUID_INSTALLED"]) { $array[] = "exec.dansguardian.last.php"; } if ($GLOBALS["EnableArticaWatchDog"] == 1) { $array2[] = "artica-install --startall"; } if ($GLOBALS["ZARAFA_INSTALLED"]) { $array[] = "exec.zarafa.adbookldap.php --all"; } if ($EnablePhileSight == 1) { $array[] = "exec.philesight.php --check"; } $array[] = "exec.test-connection.php"; $array[] = "exec.kaspersky-update-logs.php"; $array[] = "exec.emailrelay.php --notifier-queue"; $array[] = "exec.watchdog.php --queues"; $array[] = "exec.freeweb.php --perms"; $array[] = "exec.freeweb.php --all-status"; $array[] = "exec.clean.logs.php --clean-tmp2"; $array[] = "exec.syslog-engine.php --psmem"; $array[] = "exec.patchs.php"; if ($GLOBALS["UFDBGUARD_INSTALLED"]) { $array[] = "exec.web-community-filter.php --groupby"; } $array2[] = "process1 --force"; $array2[] = "artica-install --check-virus-logs"; $array2[] = "artica-install --monit-check"; $array2[] = "process1 --cleanlogs"; while (list($index, $file) = each($array)) { $cmd = "{$GLOBALS["PHP5"]} /usr/share/artica-postfix/{$file}"; events("schedule {$cmd}", __FUNCTION__, __LINE__); $GLOBALS["CMDS"][] = $cmd; } while (list($index, $file) = each($array2)) { $cmd = "/usr/share/artica-postfix/bin/{$file}"; events("schedule {$cmd}", __FUNCTION__, __LINE__); $GLOBALS["CMDS"][] = $cmd; } if ($GLOBALS["MUNIN_CLIENT_INSTALLED"]) { $GLOBALS["CMDS"][] = "{$GLOBALS["SU"]} - munin --shell=/bin/bash munin-cron"; } @file_put_contents("/etc/artica-postfix/pids/" . basename(__FILE__) . ".GLOBALS", serialize($GLOBALS["TIME"])); }
function group10() { $fileTime = "/etc/artica-postfix/cron.2/executor." . __FUNCTION__; if (file_time_min($fileTime) < 10) { return; } $EnablePhileSight = GET_INFO_DAEMON("EnablePhileSight"); if ($EnablePhileSight == null) { $EnablePhileSight = 1; } $array[] = "exec.clean.logs.php --clean-tmp"; if ($GLOBALS["OVERLOADED"]) { return; } if ($EnablePhileSight == 1) { $array[] = "exec.philesight.php --check"; } $array[] = "exec.kaspersky-update-logs.php"; $array[] = "exec.emailrelay.php --notifier-queue"; if ($GLOBALS["SQUID_INSTALLED"]) { $array[] = "exec.dansguardian.last.php"; } if ($GLOBALS["EnableArticaWatchDog"] == 1) { $array2[] = "artica-install --startall"; } $array2[] = "process1 --force"; $array2[] = "artica-install --check-virus-logs"; $array2[] = "artica-install --monit-check"; $array2[] = "process1 --cleanlogs"; while (list($index, $file) = each($array)) { $cmd = "{$_GET["PHP5"]} /usr/share/artica-postfix/{$file}"; sys_THREAD_COMMAND_SET($cmd); } while (list($index, $file) = each($array2)) { $cmd = "/usr/share/artica-postfix/bin/{$file}"; sys_THREAD_COMMAND_SET($cmd); } if ($GLOBALS["VERBOSE"]) { events(__FUNCTION__ . ":: die..."); } @unlink($fileTime); @file_put_contents($fileTime, "#"); }
function group10() { if (!isset($GLOBALS["CLASS_UNIX"])) { $GLOBALS["CLASS_UNIX"] = new unix(); } $filetime = "/etc/artica-postfix/pids/" . md5(__FILE__ . __FUNCTION__) . ".time"; $time = $GLOBALS["CLASS_UNIX"]->file_time_min($filetime); if ($time < 11) { return; } @unlink($filetime); @file_put_contents($filetime, time()); $EnablePhileSight = GET_INFO_DAEMON("EnablePhileSight"); if ($EnablePhileSight == null) { $EnablePhileSight = 1; } if ($GLOBALS["OCS_INSTALLED"]) { $array[] = "exec.ocsweb.php --injection"; } if ($GLOBALS["AUDITD_INSTALLED"]) { $array[] = "exec.auditd.php --import"; } if ($GLOBALS["EnableArticaWatchDog"] == 1) { $array2[] = "artica-install --startall"; } if ($GLOBALS["ZARAFA_INSTALLED"]) { $array[] = "exec.zarafa.adbookldap.php --all"; } $array[] = "exec.test-connection.php"; $array[] = "exec.kaspersky-update-logs.php"; $array[] = "exec.emailrelay.php --notifier-queue"; $array[] = "exec.watchdog.php --queues"; $array[] = "exec.freeweb.php --perms"; $array[] = "exec.freeweb.php --all-status"; $array[] = "exec.patchs.php"; if ($GLOBALS["UFDBGUARD_INSTALLED"]) { $array[] = "exec.web-community-filter.php --groupby"; } $array2[] = "artica-install --check-virus-logs"; $array2[] = "artica-install --monit-check"; while (list($index, $file) = each($array)) { $cmd = "{$GLOBALS["PHP5"]} /usr/share/artica-postfix/{$file}"; events("schedule {$cmd}", __FUNCTION__, __LINE__); $GLOBALS["CMDS"][] = $cmd; } while (list($index, $file) = each($array2)) { $cmd = "/usr/share/artica-postfix/bin/{$file}"; events("schedule {$cmd}", __FUNCTION__, __LINE__); $GLOBALS["CMDS"][] = $cmd; } if ($GLOBALS["MUNIN_CLIENT_INSTALLED"]) { $GLOBALS["CMDS"][] = "{$GLOBALS["SU"]} - munin --shell=/bin/bash munin-cron"; } @file_put_contents("/etc/artica-postfix/pids/" . basename(__FILE__) . ".GLOBALS", serialize($GLOBALS["TIME"])); }