コード例 #1
0
function extract_all_tgz()
{
    $sql = "SELECT * FROM metahosts WHERE blacklisted=0";
    $q = new mysql_meta();
    $results = $q->QUERY_SQL($sql);
    while ($ligne = mysql_fetch_assoc($results)) {
        $uuid = $ligne["uuid"];
        extract_tgz($uuid);
        global_status_ini($uuid);
        rotate_client($uuid);
        psaux_client($uuid);
        philesight_client($uuid);
        metaevents_client($uuid);
        metaevents_client2($uuid);
        sysalerts_smtp_client($uuid);
        articadaemons_client($uuid);
        bandwidth_squid_calc($uuid);
        articasquid_quota_size_client($uuid);
        $workingfile = "/usr/share/artica-postfix/ressources/conf/meta/hosts/uploaded/{$uuid}/SNAPSHOT/snapshot.tar.gz";
        if (is_file($workingfile)) {
            snapshot_client($uuid);
        }
    }
}
コード例 #2
0
function scan_temp_queue()
{
    $workingDir = "/home/artica/squid/META_UPLOADED_QUEUE";
    if (!is_dir($workingDir)) {
        return;
    }
    $unix = new unix();
    if (!($handle = opendir($workingDir))) {
        meta_events("{$workingDir} failed to parse");
        return;
    }
    while (false !== ($file = readdir($handle))) {
        if ($file == ".") {
            continue;
        }
        if ($file == "..") {
            continue;
        }
        if (!preg_match("#^(.+?)-([A-Z_]+)\\.gz#", $file, $re)) {
            meta_events("{$file} not correcly named...");
            continue;
        }
        $FILEBASE = $re[2];
        $uuid = $re[1];
        meta_events("Checking {$uuid} ({$FILEBASE})");
        switch ($FILEBASE) {
            case "ARTICA_DAEMONS":
                articadaemons_client($uuid);
                break;
            case "TABLE_NICS":
                uuid_TABLE_NICS($uuid);
                break;
            case "META_CLIENT_EVENTS":
                uuid_META_CLIENT_EVENTS($uuid);
                break;
            case "SQUID_PERFS":
                articasquid_perf_client($uuid);
                break;
            case "add-tab":
                main_add_tab();
                exit;
                break;
            default:
                break;
        }
    }
}