<th> <?php echo _("Target"); ?> </th> <th> <?php echo _("Extra Data"); ?> </th> </tr> <?php $host_ids_list = Host_ids::get_list($conn, "WHERE ip = inet_aton('{$ip}') and date = '{$date}'"); if ($host_ids_list) { foreach ($host_ids_list as $host) { $sid = $host->get_sid(); $sid = Host_ids::get_desc($conn, $sid); $what = Host_ids::beautify_what($host->get_what()); $event_type = $host->get_event_type(); $target = $host->get_target(); $extra_data = $host->get_extra_data(); if (preg_match('/^\\[(.*)\\]\\[(.*)\\]$/', $extra_data, $m)) { $extra_data = "<font color=\"blue\">" . $m[1] . "</font> -> <font color=\"red\">" . $m[2] . "</font>"; } printf("<TR><TD>\n {$sid}</TD><TD>\n {$what}</TD><TD>\n {$event_type}</TD><TD class=\"left\">\n <b>{$target}</b></TD><TD>\n {$extra_data}</TD><TD></TR>"); } } ?> </table> </body> </html> <?php $db->close($conn);
* Classes list: */ require_once 'classes/Session.inc'; Session::logcheck("MenuControlPanel", "ControlPanelHids"); require_once 'classes/Host_ids.inc'; require_once 'classes/Security.inc'; $limit = GET('hosts'); ossim_valid($limit, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("limit")); if (ossim_error()) { die(ossim_error()); } /* hosts to show */ if (empty($limit)) { $limit = 10; } $hids = new Host_ids("", "", "", "", "", "", "", "", "", ""); $list = $hids->Events($limit); $data = $legend = array(); foreach ($list as $l) { $legend[] = $l[0]; $data[] = $l[1]; } $conf = $GLOBALS["CONF"]; $jpgraph = $conf->get_conf("jpgraph_path"); include "{$jpgraph}/jpgraph.php"; include "{$jpgraph}/jpgraph_pie.php"; // Setup graph $graph = new PieGraph(400, 240, "auto"); $graph->SetShadow(); // Setup graph title $graph->title->Set("HIDS Events");
<hr noshade> <br> <table align="center" width="80%"> <tr> <th> <?php echo _("Host"); ?> </th><th> <?php echo _("Event date"); ?> </th><th> <?php echo _("Events"); ?> </th> </tr> <?php if ($host_ids_list = Host_ids::get_list_reduced($conn, "", "group by ip order by 'count(sid)' desc ")) { foreach ($host_ids_list as $host) { $ip = $host->get_ip(); $date = $host->get_date(); $count = $host->get_count(); printf("<TR><TH>\n <A HREF=\"host_detail.php?ip={$ip}&date={$date}\">{$ip}</A></TH>\n <TD>{$date}</TD><TD>{$count}</TD></TR>"); } } ?> </table> </body> </html> <?php $db->close($conn); exit;