Esempio n. 1
0
function scan_queue($nopid = false)
{
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pidTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $unix = new unix();
    if (!$GLOBALS["VERBOSE"]) {
        if ($nopid) {
            $pid = @file_get_contents($pidfile);
            if ($unix->process_exists($pid)) {
                writelogs("Already running pid {$pid}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
            $t = 0;
        }
        $pids = $unix->PIDOF_PATTERN_ALL("exec.syslog-engine.php --admin-evs");
        if (count($pids) > 1) {
            writelogs("2 instances already runnin.. aborting", __FUNCTION__, __FILE__, __LINE__);
            return;
        }
        $TimeExec = $unix->file_time_min($pidTime);
        if ($TimeExec < 5) {
            writelogs("Only each 5 mn", __FUNCTION__, __FILE__, __LINE__);
            return;
        }
    }
    @unlink($pidTime);
    @file_put_contents($pidTime, time());
    @file_put_contents($pidfile, getmypid());
    blackwhite_admin_mysql_check(true);
    squid_admin_notifs_check(true);
    system_rotate_events_checks(true);
    haproxy_events();
    sys_load();
    cyrus_admin_mysql_check(true);
    apache_admin_mysql_check(true);
    vsftpd_admin_mysql_check(true);
    squid_admin_mysql_check(true);
    squid_admin_enforce_check(true);
    webupdate_admin_mysql_check(true);
    nginx_admin_mysql_check(true);
    system_admin_events_checks(true);
    artica_update_task(true);
    checks_hotspot_admin_mysql(true);
    checks_stats_admin_events(true);
    squid_admin_purge_check(true);
    rotate_admin_events_checks(true);
    udfbguard_admin_events(true);
    sys_alerts(true);
    clean_mysql_events(true);
    seeker();
}
Esempio n. 2
0
    ipblocks();
    die;
}
if ($argv[1] == '--adminlogs') {
    admin_logs();
    squid_tasks();
    crossroads();
    udfbguard_admin_events();
    dhcpd_logs();
    die;
}
if ($argv[1] == '--psmem') {
    ps_mem(true);
    squid_tasks();
    crossroads();
    udfbguard_admin_events();
    dhcpd_logs();
    die;
}
if ($argv[1] == '--squid-tasks') {
    squid_tasks(true);
    die;
}
function build_server_mode()
{
    $sock = new sockets();
    $ActAsASyslogServer = $sock->GET_INFO("ActAsASyslogServer");
    if (!is_numeric($ActAsASyslogServer)) {
        echo "Starting......: syslog server parameters not defined, aborting tasks\n";
    }
    if (is_file("/etc/default/syslogd")) {