Ejemplo n.º 1
0
*/
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");
$graph->title->SetFont(FF_FONT1, FS_BOLD);