Beispiel #1
0
function group5()
{
    $fileTime = "/etc/artica-postfix/cron.2/executor." . __FUNCTION__;
    if (file_time_min($fileTime) < 5) {
        return;
    }
    writelogs("DANSGUARDIAN_INSTALLED={$GLOBALS["DANSGUARDIAN_INSTALLED"]}", __FUNCTION__, __FILE__, __LINE__);
    $unix = new unix();
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        $array[] = "exec.watchdog.postfix.queue.php";
    }
    $array["exec.dstat.top.php"] = "exec.dstat.top.php";
    $array["exec.admin.status.postfix.flow.php"] = "exec.admin.status.postfix.flow.php";
    $array["exec.admin.smtp.flow.status.php"] = "exec.admin.smtp.flow.status.php";
    $array["exec.remote-install.php"] = "exec.remote-install.php";
    $array["exec.parse.dar-xml.php"] = "exec.parse.dar-xml.php";
    $array["exec.import-networks.php"] = "exec.import-networks.php";
    $array["cron.notifs.php"] = "cron.notifs.php";
    $array["exec.watchdog.php"] = "exec.watchdog.php";
    $array["exec.postfix.iptables.php"] = "exec.postfix.iptables.php --parse-queue";
    if ($GLOBALS["DANSGUARDIAN_INSTALLED"]) {
        if (!is_file("/usr/share/artica-postfix/ressources/logs/dansguardian.patterns")) {
            $array["exec.dansguardian.compile.php --patterns"] = "exec.dansguardian.compile.php --patterns";
        }
    }
    if ($GLOBALS["SAMBA_INSTALLED"]) {
        $array["exec.xapian.index.php"] = "exec.xapian.index.php";
    }
    if (is_file("/usr/sbin/glusterfsd")) {
        $array["exec.gluster.php"] = "exec.gluster.php --notify-server";
    }
    if ($GLOBALS["EnableArticaWatchDog"] == 1) {
        $array2[] = "artica-install --start-minimum-daemons";
    }
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        if ($GLOBALS["KAS_INSTALLED"]) {
            $array2[] = "artica-update --kas3 &";
        }
    }
    if (!is_file($unix->find_program("cpulimit"))) {
        @unlink("/etc/artica-postfix/cpulimit-installed");
    }
    if (!is_file("/etc/artica-postfix/cpulimit-installed")) {
        $array2[] = "artica-make APP_CPULIMIT";
    }
    $array2[] = "artica-install --generate-status";
    if ($GLOBALS["OVERLOADED"]) {
        unset($array["exec.dstat.top.php"]);
        unset($array["exec.admin.status.postfix.flow.php"]);
        unset($array["exec.parse.dar-xml.php"]);
        unset($array["exec.import-networks.php"]);
        unset($array["exec.admin.smtp.flow.status.php"]);
    }
    while (list($index, $file) = each($array)) {
        $cmd = "{$_GET["PHP5"]} /usr/share/artica-postfix/{$file}";
        sys_THREAD_COMMAND_SET($cmd);
    }
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        mailarchives();
    }
    if (is_array($array2)) {
        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, "#");
}
Beispiel #2
0
function group5()
{
    if (!is_numeric($GLOBALS["TIME"]["GROUP5"])) {
        $GLOBALS["TIME"]["GROUP5"] = time();
        return;
    }
    if ($GLOBALS["TIME"]["GROUP5"] == 0) {
        $GLOBALS["TIME"]["GROUP5"] = time();
        return;
    }
    $mins = calc_time_min($GLOBALS["TIME"]["GROUP5"]);
    if ($mins < 5) {
        return;
    }
    events("{$GLOBALS["TIME"]["GROUP5"]} =  {$mins} Minutes / 5Mn", __FUNCTION__, __LINE__);
    $GLOBALS["TIME"]["GROUP5"] = time();
    $unix = new unix();
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        $array["exec.watchdog.postfix.queue.php"] = "exec.watchdog.postfix.queue.php";
        $array["exec.postfix.iptables.php"] = "exec.postfix.iptables.php --parse-queue";
        $array["exec.postfix.iptables.php --export-drop"] = "exec.postfix.iptables.php --export-drop";
        $array["exec.postfix-logger.php"] = "exec.postfix-logger.php --postqueue-clean";
        if ($GLOBALS["MILTER_GREYLIST_INSTALLED"]) {
            $array["exec.milter-greylist.php --database"] = "exec.milter-greylist.php --database";
        }
    }
    if ($GLOBALS["VIRTUALBOX_INSTALLED"]) {
        $array["exec.virtualbox.php --maintenance"] = "exec.virtualbox.php --maintenance";
    }
    if ($GLOBALS["KAV4PROXY_INSTALLED"]) {
        $array["exec.kaspersky-update-logs.php --av-uris"];
    }
    if ($GLOBALS["CGROUPS_INSTALLED"]) {
        $cgroupsEnabled = $GLOBALS["CLASS_SOCKETS"]->GET_INFO("cgroupsEnabled");
        if (!is_numeric($cgroupsEnabled)) {
            $cgroupsEnabled = 0;
        }
        if ($cgroupsEnabled == 1) {
            $array["exec.cgroups.php --stats"];
        }
    }
    $array["exec.dstat.top.php"] = "exec.dstat.top.php";
    $array["exec.admin.status.postfix.flow.php"] = "exec.admin.status.postfix.flow.php";
    $array["exec.admin.smtp.flow.status.php"] = "exec.admin.smtp.flow.status.php";
    //$array["exec.remote-install.php"]="exec.remote-install.php";
    $array["exec.parse.dar-xml.php"] = "exec.parse.dar-xml.php";
    $array["exec.import-networks.php"] = "exec.import-networks.php";
    $array["cron.notifs.php"] = "cron.notifs.php";
    $array["exec.watchdog.php"] = "exec.watchdog.php";
    $array["exec.nmapscan.php --scan-nets"] = "exec.nmapscan.php --scan-nets";
    $array["exec.syslog-engine.php --adminlogs"] = "exec.syslog-engine.php --adminlogs";
    if ($GLOBALS["OPENVPN_INSTALLED"]) {
        $array["exec.openvpn.php --schedule"] = "exec.openvpn.php --schedule";
    }
    if ($GLOBALS["SQUID_INSTALLED"]) {
        $array["exec.web-community-filter.php"] = "exec.web-community-filter.php";
        if ($GLOBALS["DANSGUARDIAN_INSTALLED"]) {
            if (!is_file("/usr/share/artica-postfix/ressources/logs/dansguardian.patterns")) {
                $array["exec.dansguardian.compile.php --patterns"] = "exec.dansguardian.compile.php --patterns";
            }
        }
        $array["exec.squid.logs.migrate.php"] = "exec.squid.logs.migrate.php";
    }
    if ($GLOBALS["SAMBA_INSTALLED"]) {
        if ($GLOBALS["XAPIAN_PHP_INSTALLED"]) {
            $array["exec.xapian.index.php"] = "exec.xapian.index.php";
        }
        $array["exec.samba.php --smbtree"] = "exec.samba.php --smbtree";
        $array["exec.samba.php --smbstatus"] = "exec.samba.php --smbstatus";
    }
    if (is_file("/usr/sbin/glusterfsd")) {
        $array["exec.gluster.php"] = "exec.gluster.php --notify-server";
    }
    if ($GLOBALS["EnableArticaWatchDog"] == 1) {
        $array2[] = "artica-install --start-minimum-daemons";
    }
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        if ($GLOBALS["KAS_INSTALLED"]) {
            $array2[] = "artica-update --kas3";
        }
    }
    $array2[] = "artica-install --generate-status";
    if ($GLOBALS["OVERLOADED"]) {
        unset($array["exec.dstat.top.php"]);
        unset($array["exec.admin.status.postfix.flow.php"]);
        unset($array["exec.parse.dar-xml.php"]);
        unset($array["exec.import-networks.php"]);
        unset($array["exec.admin.smtp.flow.status.php"]);
    }
    while (list($index, $file) = each($array)) {
        $cmd = "{$GLOBALS["PHP5"]} /usr/share/artica-postfix/{$file}";
        events("schedule {$cmd}", __FUNCTION__, __LINE__);
        $GLOBALS["CMDS"][] = $cmd;
    }
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        mailarchives();
    }
    if (is_array($array2)) {
        while (list($index, $file) = each($array2)) {
            $cmd = "/usr/share/artica-postfix/bin/{$file}";
            events("schedule {$cmd}", __FUNCTION__, __LINE__);
            $GLOBALS["CMDS"][] = $cmd;
        }
    }
    @file_put_contents("/etc/artica-postfix/pids/" . basename(__FILE__) . ".GLOBALS", serialize($GLOBALS["TIME"]));
}
Beispiel #3
0
function group5()
{
    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 < 6) {
        return;
    }
    @unlink($filetime);
    @file_put_contents($filetime, time());
    $unix = new unix();
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        $array["exec.watchdog.postfix.queue.php"] = "exec.watchdog.postfix.queue.php";
        $array["exec.postfix.iptables.php"] = "exec.postfix.iptables.php --parse-queue";
        $array["exec.postfix.iptables.php --export-drop"] = "exec.postfix.iptables.php --export-drop";
        $array["exec.smtp-senderadv.php"] = "exec.smtp-senderadv.php";
    }
    if ($GLOBALS["VIRTUALBOX_INSTALLED"]) {
        $array["exec.virtualbox.php --maintenance"] = "exec.virtualbox.php --maintenance";
    }
    if ($GLOBALS["KAV4PROXY_INSTALLED"]) {
        $array["exec.kaspersky-update-logs.php --av-uris"];
    }
    if ($GLOBALS["OPENVPN_INSTALLED"]) {
        $array["exec.openvpn.php --schedule"] = "exec.openvpn.php --schedule";
    }
    if ($GLOBALS["SQUID_INSTALLED"]) {
        $array["exec.squid.logs.migrate.php"] = "exec.squid.logs.migrate.php";
    }
    if ($GLOBALS["SAMBA_INSTALLED"]) {
        $array["exec.samba.php --smbtree"] = "exec.samba.php --smbtree";
        $array["exec.samba.php --smbstatus"] = "exec.samba.php --smbstatus";
    }
    if (is_file("/usr/sbin/glusterfsd")) {
        $array["exec.gluster.php"] = "exec.gluster.php --notify-server";
    }
    if ($GLOBALS["EnableArticaWatchDog"] == 1) {
        $array2[] = "artica-install --start-minimum-daemons";
    }
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        if ($GLOBALS["KAS_INSTALLED"]) {
            $array2[] = "artica-update --kas3";
        }
    }
    $array2[] = "artica-install --generate-status";
    if ($GLOBALS["OVERLOADED"]) {
        unset($array["exec.admin.status.postfix.flow.php"]);
        unset($array["exec.admin.smtp.flow.status.php"]);
    }
    while (list($index, $file) = each($array)) {
        $cmd = "{$GLOBALS["PHP5"]} /usr/share/artica-postfix/{$file}";
        events("schedule {$cmd}", __FUNCTION__, __LINE__);
        $GLOBALS["CMDS"][] = $cmd;
    }
    if ($GLOBALS["POSTFIX_INSTALLED"]) {
        mailarchives();
    }
    if (is_array($array2)) {
        while (list($index, $file) = each($array2)) {
            $cmd = "/usr/share/artica-postfix/bin/{$file}";
            events("schedule {$cmd}", __FUNCTION__, __LINE__);
            $GLOBALS["CMDS"][] = $cmd;
        }
    }
    @file_put_contents("/etc/artica-postfix/pids/" . basename(__FILE__) . ".GLOBALS", serialize($GLOBALS["TIME"]));
}