function jgraph_attack_graph($target, $hosts, $type = "Bar3D", $width = 450, $height = 250) { global $security_report; global $datapath; global $base_dir; if (!strcmp($target, "ip_src")) { if (!($fp = @fopen("{$base_dir}/tmp/ip_src.xml", "w"))) { print "Error: <b>{$datapath}</b> directory must exists and be <br/>\n"; print "writable by the user the webserver runs as"; exit; } } else { if (!($fp = @fopen("{$base_dir}/tmp/ip_dst.xml", "w"))) { print "Error: <b>{$datapath}</b> directory must exists and be <br/>\n"; print "writable by the user the webserver runs as"; exit; } } fwrite($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" . "<CategoryDataset>\n <Series name=\"{$target}\">\n"); $list = $security_report->AttackHost($target, $hosts); foreach ($list as $l) { $ip = $l[0]; $occurrences = $l[1]; $hostname = Host::ip2hostname($security_report->ossim_conn, $ip); $os_pixmap = Host_os::get_os_pixmap($security_report->ossim_conn, $ip); if (strlen($hostname) > MAX_HOSTNAME_LEN) { $hostname = $ip; } fwrite($fp, " <Item>\n <Key>{$hostname}</Key>\n <Value>{$occurrences}</Value>\n </Item>\n"); } fwrite($fp, " </Series>\n</CategoryDataset>\n\n"); fclose($fp); echo "\n<applet archive=\"../java/jcommon-0.9.5.jar,../java/jfreechart-0.9.20.jar,../java/jossim-graph.jar\" code=\"net.ossim.graph.applet.OssimGraphApplet\" width=\"{$width}\" height=\"{$height}\" alt=\"You should see an applet, not this text.\">\n <param name=\"graphType\" value=\"{$type}\">"; if (!strcmp($target, "ip_src")) { echo " <param name=\"xmlDataUrl\" value=\"{$datapath}/ip_src.xml\">"; } else { echo " <param name=\"xmlDataUrl\" value=\"{$datapath}/ip_dst.xml\">"; } echo "\n <param name=\"alpha\" value=\"0.42f\">\n <param name=\"legend\" value=\"false\">\n <param name=\"tooltips\" value=\"false\">\n <param name=\"orientation\" value=\"HORIZONTAL\">\n</applet>\n"; }
function host_row_basic($host, $conn, $criterias, $has_criterias, $networks, $hosts_ips, $i) { require_once "classes/Sensor.inc"; $color = $i % 2 == 0 ? "#F2F2F2" : "#FFFFFF"; $ip = $host->get_ip(); $host_name = $ip != $host->get_hostname() ? $host->get_hostname() . " ({$ip})" : $ip; $gi = geoip_open("/usr/share/geoip/GeoIP.dat", GEOIP_STANDARD); $country = strtolower(geoip_country_code_by_addr($gi, $ip)); $country_name = geoip_country_name_by_addr($gi, $ip); geoip_close($gi); if ($country) { $country_img = " <img src=\"../pixmaps/flags/" . $country . ".png\" alt=\"{$country_name}\" title=\"{$country_name}\">"; } else { $country_img = ""; } //$homelan = (Net::isIpInNet($ip, $networks) || in_array($ip, $hosts_ips)) ? " <a href=\"javascript:;\" class=\"scriptinfo\" style=\"text-decoration:none\" ip=\"".$ip."\"><img src=\"../forensics/images/homelan.png\" border=0></a>" : ""; // Network require_once 'classes/Net.inc'; $netname = Net::GetClosestNet($conn, $ip); if ($netname != false) { $ips = Net::get_ips_by_name($conn, $netname); $net = "<b>{$netname}</b> ({$ips})"; } else { $net = "<i>" . _("Asset Unknown") . "</i>"; } // Inventory $os_data = Host_os::get_ip_data($conn, $ip); if ($os_data["os"] != "") { $os = $os_data["os"]; $os_pixmap = Host_os::get_os_pixmap($conn, $ip); } else { $os = _("OS Unknown"); $os_pixmap = ""; } require_once 'classes/Host_services.inc'; $services = Host_services::get_ip_data($conn, $ip, 0); $services_arr = array(); foreach ($services as $serv) { $services_arr[$serv['service']]++; } // Vulnerabilities require_once 'classes/Status.inc'; list($vuln_list, $num_vuln, $vuln_highrisk, $vuln_risknum) = Status::get_vul_events($conn, $ip); $vuln_list_str = ""; $v = 0; foreach ($vuln_list as $vuln) { if ($v++ < 20) { $vuln_list_str .= $vuln['name'] . "<br>"; } } $vuln_list_str = str_replace("\"", "", $vuln_list_str); $vuln_caption = $num_vuln > 0 ? ' class="greybox_caption" data="' . $vuln_list_str . '"' : ' class="greybox"'; // Incidents $sql = "SELECT count(*) as num FROM alarm WHERE src_ip=INET_ATON(\"{$ip}\") OR dst_ip=INET_ATON(\"{$ip}\")"; if (!($rs =& $conn->Execute($sql))) { $num_alarms = _("Error in Query: {$sql}"); } else { if (!$rs->EOF) { $num_alarms = $rs->fields['num']; } } if ($num_alarms > 0) { $alarm_link = '<a href="../control_panel/alarm_console.php?&hide_closed=1&hmenu=Alarms&smenu=Alarms&src_ip=' . $ip . '&dst_ip=' . $ip . '" target="main"><b>' . $num_alarms . '</b></a>'; } else { $alarm_link = '<b>' . $num_alarms . '</b>'; } $sql = "SELECT count(*) as num FROM incident_alarm WHERE src_ips=\"{$ip}\" OR dst_ips=\"{$ip}\""; if (!($rs =& $conn->Execute($sql))) { $num_tickets = _("Error in Query: {$sql}"); } else { if (!$rs->EOF) { $num_tickets = $rs->fields['num']; } } if ($num_tickets > 0) { $tickets_link = '<a href="../incidents/index.php?status=Open&hmenu=Tickets&smenu=Tickets&with_text=' . $ip . '" target="main"><b>' . $num_tickets . '</b></a>'; } else { $tickets_link = '<b>' . $num_tickets . '</b>'; } // Events list($sim_events, $sim_foundrows, $sim_highrisk, $sim_risknum, $sim_date) = Status::get_SIM_light($ip, $ip); if ($sim_foundrows > 0) { $sim_link = '<a href="../forensics/base_qry_main.php?&num_result_rows=-1&submit=Query+DB¤t_view=-1&sort_order=time_d&ip=' . $ip . '&date_range=week&hmenu=Forensics&smenu=Forensics" target="main"><b>' . $sim_foundrows . '</b></a>'; } else { $sim_link = '<b>' . $sim_foundrows . '</b>'; } // $txt_tmp1 = _('Events in the SIEM'); $txt_tmp2 = _('Events in the logger'); if ($_SESSION['inventory_search']['date_from'] != "" && $_SESSION['inventory_search']['date_from'] != '1700-01-01') { $start_week = $_SESSION['inventory_search']['date_from']; } else { $start_week = strftime("%Y-%m-%d", time() - 24 * 60 * 60 * 1); } if ($_SESSION['inventory_search']['date_to'] != "" && $_SESSION['inventory_search']['date_to'] != '3000-01-01') { $end = $_SESSION['inventory_search']['date_to']; } else { $end = strftime("%Y-%m-%d", time()); } if ($start_week == strftime("%Y-%m-%d", time() - 24 * 60 * 60 * 1) && $end == strftime("%Y-%m-%d", time())) { $txt_tmp1 .= _(' (Last Week)'); $txt_tmp2 .= _(' (Last Day)'); } $start_week_temp = $start_week; $start_week .= ' 00:00:00'; $end_temp = $end; $end .= ' 23:59:59'; // //$start_week = strftime("%Y-%m-%d %H:%M:%S", time() - (24 * 60 * 60 * 7)); //$end = strftime("%Y-%m-%d %H:%M:%S", time()); list($sem_events_week, $sem_foundrows_week, $sem_date, $sem_wplot_y, $sem_wplot_x) = Status::get_SEM("", $start_week, $end, "none", 1234, $ip); if ($sem_foundrows_week > 0) { $sem_link = '<a href="../sem/index.php?hmenu=SEM&smenu=SEM&query=' . urlencode($ip) . '&start=' . urlencode($start_week) . '" target="main"><b>' . $sem_foundrows_week . '</b></a>'; } else { $sem_link = '<b>' . $sem_foundrows_week . '</b>'; } // Anomalies list($event_list, $anm_foundrows, $anm_foundrows_week, $anm_date) = Status::get_anomalies($conn, $ip); // Ntp link $ntop_lnk = Sensor::get_sensor_link($conn, $ip); if (preg_match("/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $ntop_lnk, $fnd)) { $ntop_ip = $fnd[1]; } else { $ntop_ip = $ip; } // $row = '<tr bgcolor="' . $color . '"> <td class="nobborder" style="text-align:center;padding:2px"><a href="../report/host_report.php?host=' . $ip . '&star_date=' . $start_week_temp . '&end_date=' . $end_temp . '" id="' . $ip . ';' . $host->get_hostname() . '" class="HostReportMenu" style="color:#17457c;font-size:15px;text-align:left"><b>' . $host_name . '</b></font></a><br><font style="color:gray">' . $net . '</font></td> <td class="nobborder" style="text-align:center;padding:2px">' . $os . ' ' . $os_pixmap . '<br>' . implode("<br>", array_keys($services_arr)) . '</td> <td class="nobborder" style="text-align:center;padding:2px"><a href="../vulnmeter/index.php?value=' . $ip . '&type=hn&withoutmenu=1&hmenu=Vulnerabilities&smenu=Vulnerabilities" title="Top 20 ' . _("Vulnerabilities for") . ' ' . $ip . '"' . $vuln_caption . '>' . $num_vuln . '</a></td> <td class="nobborder" style="text-align:center;padding:2px">' . $alarm_link . ' ' . _("Alarms") . '<br>' . $tickets_link . ' ' . _("Tickets") . '</td> <td class="nobborder" style="padding:2px">' . $sim_link . ' ' . $txt_tmp1 . '<br>' . $sem_link . ' ' . $txt_tmp2 . '</td> <td class="nobborder" style="text-align:center;padding:2px"><a href="../control_panel/anomalies.php?withoutmenu=1" class="greybox" title="' . _("Anomalies") . '"><b>' . $anm_foundrows . '</b></a></td> <td class="nobborder" style="text-align:center;padding:2px"> <table class="transparent"> <tr> <td class="nobborder"><img src="../pixmaps/ntop_graph_thumb.gif" width="40"></td> <td class="nobborder"><a href="../ntop/index.php?opc=services&sensor=' . $ntop_ip . '&hmenu=Network&smenu=Profiles&link_ip=' . $ip . '" target="main">' . _("Traffic Sent/Rcvd") . '</a></td> </tr> </table> </td> </tr>'; // <td class="nobborder"><a href="'.Sensor::get_sensor_link($conn,$ip).'/hostTimeTrafficDistribution-'.$ip.'-65535.png?1" class="greybox">'._("Traffic Sent").'</a><br><a href="'.Sensor::get_sensor_link($conn,$ip).'/hostTimeTrafficDistribution-'.$ip.'-65535.png" class="greybox">'._("Traffic Rcvd").'</a></td> echo str_replace("\n", "", str_replace("\r", "", str_replace("'", "", $row))); }
?> </td> <td style="padding-left:3px;padding-right:3px" class="center nobborder"> <?php $acid_link = Util::get_acid_events_link($since, $date, "time_d"); echo "\n <a href=\"{$acid_link}\">\n <font color=\"black\">{$date}</font></a>\n "; ?> </td> <?php $src_link = "../forensics/base_stat_ipaddr.php?clear_allcriteria=1&ip={$src_ip}&hmenu=Forensics&smenu=Forensics"; $dst_link = "../forensics/base_stat_ipaddr.php?clear_allcriteria=1&ip={$dst_ip}&hmenu=Forensics&smenu=Forensics"; $src_name = $no_resolv ? $src_ip : Host::ip2hostname($conn, $src_ip); $dst_name = $no_resolv ? $dst_ip : Host::ip2hostname($conn, $dst_ip); $src_img = Host_os::get_os_pixmap($conn, $src_ip); $dst_img = Host_os::get_os_pixmap($conn, $dst_ip); $src_country = strtolower(geoip_country_code_by_addr($gi, $src_ip)); $src_country_name = geoip_country_name_by_addr($gi, $src_ip); $src_country_img = "<img src=\"/ossim/pixmaps/flags/" . $src_country . ".png\" title=\"" . $src_country_name . "\">"; $dst_country = strtolower(geoip_country_code_by_addr($gi, $dst_ip)); $dst_country_name = geoip_country_name_by_addr($gi, $dst_ip); $dst_country_img = "<img src=\"/ossim/pixmaps/flags/" . $dst_country . ".png\" title=\"" . $dst_country_name . "\">"; ?> <!-- src & dst hosts --> <td nowrap style="text-align:center;padding-left:3px;padding-right:3px" class="nobborder"> <div id="<?php echo $src_ip; ?> ;<?php echo $src_name; ?>
if ($fd = @fopen("{$ntop_link}/{$host}.html", "r")) { while (!feof($fd)) { $line = fgets($fd, 1024); /* * search for Sessions section */ if (eregi(">Active.*Sessions<", $line)) { $found = 1; } /* * begin to print at the begin of <table>... */ if ($found && eregi('<table', $line)) { $show = 1; $hostname = Host::ip2hostname($conn, $host); $os_pixmap = Host_os::get_os_pixmap($conn, $host); if (strcmp($hostname, $host)) { $hostname .= " ({$host})"; } echo "<HTML>\n <HEAD>\n <TITLE> \nEOF; \n echo gettext(\"Active TCP Sessions\");\necho <<<EOF\n </TITLE>\n <LINK REL=stylesheet HREF=\"{$ntop_link}/style.css\" type=\"text/css\">\n </HEAD>\n <BODY BGCOLOR=\"#FFFFFF\" LINK=blue VLINK=blue>\n <H2 align=\"center\">\n <a href=\"../report/index.php?section=usage&host={$host}\">{$hostname}</a>\n {$os_pixmap}\n </H2>\n<CENTER>"; } /* * </table> found, session section finished, stop printing */ if ($found && eregi('</table', $line)) { $show = 0; $found = 0; echo <<<EOF </CENTER> </TABLE> <BR/>
$host_list = Host::get_list($conn, $search, "ORDER BY {$order} {$limit}"); if ($host_list[0]) { $total = $host_list[0]->get_foundrows(); if ($total == 0) { $total = count($host_list); } } else { $total = 0; } $xml .= "<rows>\n"; $xml .= "<page>{$page}</page>\n"; $xml .= "<total>{$total}</total>\n"; foreach ($host_list as $host) { $ip = $host->get_ip(); $xml .= "<row id='{$ip}'>"; $name = $host->get_imgtag() . " <a style='font-weight:bold;' href=\"./modifyhostform.php?ip=" . urlencode($ip) . "\">" . $host->get_hostname() . "</a> " . Host_os::get_os_pixmap($conn, $ip); $xml .= "<cell><![CDATA[" . $name . "]]></cell>"; $xml .= "<cell><![CDATA[" . $ip . "]]></cell>"; $fqdns = $host->get_fqdns(); if ($fqdns == "") { $fqdns = " "; } $xml .= "<cell><![CDATA[" . utf8_encode($fqdns) . "]]></cell>"; $desc = $host->get_descr(); if ($desc == "") { $desc = " "; } $xml .= "<cell><![CDATA[" . utf8_encode($desc) . "]]></cell>"; $xml .= "<cell><![CDATA[" . $host->get_asset() . "]]></cell>"; $sensors = ""; if ($sensor_list = $host->get_sensors($conn)) {
function ip_max_occurrences($target, $date_from, $date_to) { global $NUM_HOSTS; global $security_report; global $report_type; /* ossim framework conf */ $conf = $GLOBALS["CONF"]; $acid_link = $conf->get_conf("acid_link"); $ossim_link = $conf->get_conf("ossim_link"); $acid_prefix = $conf->get_conf("event_viewer"); $report_graph_type = $conf->get_conf("report_graph_type"); if (!strcmp($target, "ip_src")) { if ($report_type == "alarm") { $target = "src_ip"; } $title = _("Attacker hosts"); } elseif (!strcmp($target, "ip_dst")) { if ($report_type == "alarm") { $target = "dst_ip"; } $title = _("Attacked hosts"); } $list = $security_report->AttackHost($security_report->ossim_conn, $target, $NUM_HOSTS, $report_type, $date_from, $date_to); if (count($list) == 0) { echo "<table align='center' class='nobborder'><tr><td class='nobborder'>" . _("No data available") . "</td></tr></table></body></html>"; exit(0); } ?> <table align="center" width="750" cellpadding="0" cellspacing="0" class="noborder"> <tr><td class="headerpr"><?php echo _("Top"); echo " {$NUM_HOSTS} {$title}"; ?> </td></tr> </table> <table align="center" width="750"> <tr><td style="padding-top:15px;" valign="top" class="nobborder"> <table align="center"> <tr> <th> <?php echo gettext("Host"); ?> </th> <th> <?php echo gettext("Occurrences"); ?> </th> </tr> <?php foreach ($list as $l) { $ip = $l[0]; $occurrences = number_format($l[1], 0, ",", "."); $hostname = Host::ip2hostname($security_report->ossim_conn, $ip); $os_pixmap = Host_os::get_os_pixmap($security_report->ossim_conn, $ip); if ($report_type == "alarm") { if ($target == "src_ip") { $link = "{$ossim_link}/control_panel/alarm_console.php?src_ip=" . $ip; } elseif ($target == "dst_ip") { $link = "{$ossim_link}/control_panel/alarm_console.php?dst_ip=" . $ip; } else { $link = "{$ossim_link}/control_panel/alarm_console.php?src_ip=" . $ip . "&dst_ip=" . $ip; } } else { $link = "{$acid_link}/" . $acid_prefix . "_stat_alerts.php?&" . "num_result_rows=-1&" . "submit=Query+DB&" . "current_view=-1&" . "ip_addr[0][1]={$target}&" . "ip_addr[0][2]==&" . "ip_addr[0][3]={$ip}&" . "ip_addr_cnt=1&" . "sort_order=time_d"; } ?> <tr> <td><div id="<?php echo $ip; ?> ;<?php echo $hostname; ?> " class="HostReportMenu" style="display:inline"> <a title="<?php echo $ip; ?> " href="<?php echo $link; ?> "><?php echo $hostname; ?> </a></div> <?php echo $os_pixmap; ?> </td> <td><?php echo $occurrences; ?> </td> </tr> <?php } ?> </table> </td> <td valign="top" class="nobborder"> <?php if ($report_graph_type == "applets") { jgraph_attack_graph($target, $NUM_HOSTS); } else { ?> <img src="graphs/attack_graph.php?target=<?php echo $target; ?> &hosts=<?php echo $NUM_HOSTS; ?> &type=<?php echo $report_type; ?> &date_from=<?php echo urlencode($date_from); ?> &date_to=<?php echo urlencode($date_to); ?> " alt="attack_graph"/> <?php } ?> </td> </tr> </table> <?php }
$s_asset_src = array_key_exists($s_src_ip, $assets) ? $assets[$s_src_ip] : $default_asset; $s_asset_dst = array_key_exists($s_dst_ip, $assets) ? $assets[$s_dst_ip] : $default_asset; /* $s_src_port = Port::port2service($conn, $s_src_port); $s_dst_port = Port::port2service($conn, $s_dst_port); */ $s_src_link = "../report/index.php?host={$s_src_ip}§ion=events"; $src_title = gettext("Src Asset:") . " <b>{$s_asset_src}</b><br>IP: <b>{$s_src_ip}</b>"; $s_dst_link = "../report/index.php?host={$s_dst_ip}§ion=events"; $dst_title = gettext("Dst Asset:") . " <b>{$s_asset_dst}</b><br>IP: <b>{$s_dst_ip}</b>"; $s_src_name = $no_resolv ? $s_src_ip : Host::ip2hostname($conn, $s_src_ip); $s_dst_name = $no_resolv ? $s_dst_ip : Host::ip2hostname($conn, $s_dst_ip); // $s_src_name = $s_src_ip; // $s_dst_name = $s_dst_ip; $s_src_img = str_replace("\"", "'", Host_os::get_os_pixmap($conn, $s_src_ip)); $s_dst_img = str_replace("\"", "'", Host_os::get_os_pixmap($conn, $s_dst_ip)); $src_country = strtolower(geoip_country_code_by_addr($gi, $s_src_ip)); $src_country_img = $src_country ? "<img src='/ossim/pixmaps/flags/" . $src_country . ".png'>" : ""; $dst_country = strtolower(geoip_country_code_by_addr($gi, $s_dst_ip)); $dst_country_img = $dst_country ? "<img src='/ossim/pixmaps/flags/" . $dst_country . ".png'>" : ""; $source_link = "<a href='" . $s_src_link . "' title='" . $s_src_ip . "' >" . $s_src_name . "</a>:" . $s_src_port . " {$s_src_img} {$src_country_img}"; $source_balloon = "<div class='balloon'>" . $source_link . "<span class='tooltip'><span class='top'></span><span class='middle ne11'>{$src_title}</span><span class='bottom'></span></span></div>"; $dest_link = "<a href='" . $s_dst_link . "' title='" . $s_dst_ip . "' >" . $s_dst_name . "</a>:" . $s_dst_port . " {$s_dst_img} {$dst_country_img}"; $dest_balloon = "<div class='balloon'>" . $dest_link . "<span class='tooltip'><span class='top'></span><span class='middle ne11'>{$dst_title}</span><span class='bottom'></span></span></div>"; // $selection_array[$group_id][$child_number] = $s_backlog_id . "-" . $s_event_id; $s_sid_name = ""; if ($s_plugin_sid_list = Plugin_sid::get_list($conn, "WHERE plugin_id = {$s_id} AND sid = {$s_sid}")) { $s_sid_name = $s_plugin_sid_list[0]->get_name(); $s_sid_priority = $s_plugin_sid_list[0]->get_priority(); } else { $s_sid_name = "Unknown (id={$s_id} sid={$s_sid})";
<tr> <td style="height:106px" align="center"> <div id="graph2" style="text-align:center;margin:0px;height:104px;width:98%"></div> </td> </tr> <script language="javascript" type="text/javascript"> $( function () { $.plot($("#graph2"), [ <?php $i = 0; foreach ($list2 as $l) { $ip = $l[0]; $occurrences = Util::number_format_locale($l[1], 0); $hostname = Host::ip2hostname($conn, $ip); $os_pixmap = Host_os::get_os_pixmap($conn, $ip); $label = str_replace("'", "\\'", "[<b>{$occurrences}</b>] {$hostname} {$os_pixmap}"); //if (strlen($label)>31) $label = substr($label, 0, 30).".."; ?> <?php echo $i++ == 0 ? "" : ","; ?> { label: '<?php echo $label; ?> ', data: <?php echo $l[1]; ?> } <?php }
echo $host; ?> </b></td> </tr> <?php if ($os = Host_os::get_ip_data($conn, $host)) { ?> <tr> <th> <?php echo gettext("Operating System"); ?> </th> <td> <?php echo $os["os"]; echo Host_os::get_os_pixmap($conn, $host); ?> </td> </tr> <?php } ?> <?php if ($mac = Host_mac::get_ip_data($conn, $host)) { ?> <tr> <th>MAC</th> <td><?php echo $mac["mac"]; ?>
<th>Ip</th> <td><strong><?php echo $host; ?> </strong></td> </tr> <?php if ($os = Host_os::get_ip_data($conn, $host)) { ?> <tr> <th><?php echo _("OS"); ?> </th> <td><?php echo $os["os"] . Host_os::get_os_pixmap($conn, $host); ?> </td> </tr> <?php } if ($mac = Host_mac::get_ip_data($conn, $host)) { ?> <tr> <th>MAC</th> <td><?php echo $mac["mac"]; ?> </td> </tr> <?php
<!-- C & A levels for each IP --> <tr> <td align="center"> <a href="../report/index.php?host=<?php echo $ip; ?> §ion=metrics" title="<?php echo $ip; ?> "><?php echo $hostname; ?> </a> <?php echo Host_os::get_os_pixmap($conn, $ip); ?> </td> <td align="center"> <a href="<?php echo "../control_panel/show_image.php?range=day&ip={$ip}&what=compromise&start=N-1D&type=host&zoom=1"; ?> " target="main"> <img src="../pixmaps/graph.gif" border="0"/> </a> </td> <td class="left"> <?php if ($compromise <= $threshold_c) { ?> <img src="../pixmaps/solid-blue.jpg" height="12"
$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); $user = $host->get_user(); if ($host->get_status() == 0) { $status = "<img src='../pixmaps/tables/cross.png' alt='" . _("Disabled") . "' title='" . _("Disabled") . "'/>"; } else { if ($host->get_status() == 1) { $status = "<img src='../pixmaps/tables/tick.png' alt='" . _("Enabled") . "' title='" . _("Enabled") . "'/>"; } else { $status = "<img src='../pixmaps/tables/exclamation.png' alt='" . _("Not configured") . "' title='" . _("Not configured") . "'/>"; } } $desc = $host->get_descr() == '' ? " " : Util::htmlentities($host->get_descr()); $xml .= "<row id='{$ip}'>"; $xml .= "<cell><![CDATA[" . $hostname . "]]></cell>"; $xml .= "<cell><![CDATA[" . $ip . "]]></cell>"; $xml .= "<cell><![CDATA[" . $user . "]]></cell>";
<tr> <td bgcolor="<?php echo $bgcolor; ?> "><a href="host_report.php?host=<?php echo $h->ip; ?> " class="HostReportMenu" id="<?php echo $h->ip; ?> ;<?php echo $h->hostname; ?> "><?php echo $h->hostname . " " . Host_os::get_os_pixmap($conn, $h->ip); ?> </a> </td> <td bgcolor="<?php echo $bgcolor; ?> "><a href="host_report.php?host=<?php echo $h->ip; ?> " class="HostReportMenu" id="<?php echo $h->ip; ?> ;<?php echo $h->hostname; ?>