Beispiel #1
0
} else {
    exec("cat /dev/null > {$path_passlist}", $output, $retval);
    $output = null;
}
$result = test_conf();
if ($result !== true) {
    $info_error = "<div class='errors_ossec'>{$result}</div>";
    $error_conf = true;
}
$db = new ossim_db();
$conn = $db->connect();
$info_error = null;
$error = array();
$agentless_list = array();
$agentless_xml = array();
$agentless_list = Agentless::get_list($conn, "");
if (!empty($agentless_list) && empty($info_error)) {
    foreach ($agentless_list as $k => $v) {
        $ip = $k;
        $extra = "WHERE ip = '{$ip}'";
        $monitoring_entries = Agentless::get_list_m_entries($conn, $extra);
        $user = $v->get_user();
        $host = !empty($ppass) ? "use_su " : "";
        $host .= $user . "@" . $ip;
        $pass = $v->get_pass();
        $ppass = $v->get_ppass();
        $status = $v->get_status();
        if ($status == "1" || $status == "2") {
            $res = Agentless::enable_host($ip, $user, $pass, $ppass);
            if ($res == false) {
                $info_error = _("Error to add Agentless Host");
Beispiel #2
0
    } else {
        if (is_array($message_error) && !empty($message_error)) {
            $info_error = "<div>" . _("We Found the following errors") . ":</div><div style='padding:10px;'>" . implode("<br/>", $message_error) . "</div>";
        }
    }
}
//Form actions
ossim_valid($ip, OSS_IP_ADDR, 'illegal:' . _("Ip Address"));
if (ossim_error()) {
    $info_error = ossim_get_error();
    ossim_clean_error();
} else {
    $db = new ossim_db();
    $conn = $db->connect();
    $extra = "WHERE ip = '{$ip}'";
    $agentless = array_shift(Agentless::get_list($conn, $extra));
    if (!empty($agentless)) {
        $ip = $agentless->get_ip();
        $hostname = $agentless->get_hostname();
        $user = $agentless->get_user();
        $pass = Util::fake_pass($agentless->get_pass());
        $passc = $pass;
        $ppass = Util::fake_pass($agentless->get_ppass());
        $ppassc = $ppass;
        $descr = $agentless->get_descr();
        $error_m_entries = null;
        $monitoring_entries = Agentless::get_list_m_entries($conn, $extra);
        if (!is_array($monitoring_entries)) {
            $error_m_entries = $monitoring_entries;
            $monitoring_entries = array();
        }
Beispiel #3
0
                            Agentless::add_monitoring_entry($conn, $ip, $type, $frequency, $state, $arguments);
                        }
                    }
                    $entry = null;
                    $i = $j++;
                    break;
                }
            }
        } else {
            $i++;
        }
    }
}
$agentless_list = null;
$extra = !empty($search) ? $search . " ORDER BY {$order} {$limit}" : "ORDER BY {$order} {$limit}";
$agentless_list = Agentless::get_list($conn, $extra);
if (!empty($agentless_list)) {
    $key = array_keys($agentless_list);
    $total = $agentless_list[$key[0]]->get_foundrows();
    if ($total == 0) {
        $total = count($agentless_list);
    }
} else {
    $total = 0;
}
$xml .= "<rows>\n";
$xml .= "<page>{$page}</page>\n";
$xml .= "<total>{$total}</total>\n";
foreach ($agentless_list as $host) {
    $ip = $host->get_ip();
    $hostname = "<a style='font-weight:bold;' href='./al_modifyform.php?ip=" . urlencode($ip) . "'>" . $host->get_hostname() . "</a>" . Host_os::get_os_pixmap($conn, $ip);