Exemple #1
0
$title = GET('title');
ossim_valid($n, OSS_DIGIT, 'illegal:' . _("n"));
ossim_valid($host, OSS_IP_ADDRCIDR, 'illegal:' . _("host"));
ossim_valid($title, OSS_TEXT, 'illegal:' . _("title"));
if (ossim_error()) {
    die(ossim_error());
}
$gbh = 300;
$gbw = 370;
// Network
if (preg_match("/\\/\\d+/", $host)) {
    require_once "ossim_conf.inc";
    $conf = $GLOBALS["CONF"];
    //list($protocol, $ip, $port) = split(':', $conf->get_conf("ntop_link"));
    //$sensor_ip = (!$conf->get_conf("use_ntop_rewrite")) ? "$protocol:$ip:$port" : "$protocol:$ip/ntop";
    $sensor_ip = Sensor::get_net_sensor_link($conn, $host);
    $source1 = "{$sensor_ip}/ipProtoDistribution.png";
    $tit = $title . " Service Distribution";
    $tit2 = "Service Distribution";
    $graph = "ntop_graph_thumb.gif";
    $source2 = "{$sensor_ip}/plugins/rrdPlugin?action=graphSummary&graphId=4&key=interfaces/eth0/&start=now-12h&end=now";
    $gbh = 500;
    $gbw = 520;
    $salida1 = get_headers($source1);
    $salida2 = get_headers($source2);
    if (!preg_match("/Not Found/", $salida1[0]) && $salida1 != null || !preg_match("/Not Found/", $salida2[0]) && $salida2 != null) {
        ?>
	<table align="center" class="noborder">
		<tr><td class="nobborder" style="text-align:center"><a href="net_report_graphs.php?net=<?php 
        echo urlencode($host);
        ?>
* Class and Function List:
* Function list:
* Classes list:
*/
require_once "ossim_conf.inc";
require_once "ossim_db.inc";
require_once 'classes/Sensor.inc';
$db = new ossim_db();
$conn = $db->connect();
$net = GET('net');
ossim_valid($net, OSS_IP_ADDRCIDR, 'illegal:' . _("host"));
if (ossim_error()) {
    die(ossim_error());
}
error_reporting(0);
$ntop_link = Sensor::get_net_sensor_link($conn, $net);
$source1 = $ntop_link . "/ipProtoDistribution.png";
$source2 = $ntop_link . "/plugins/rrdPlugin?action=graphSummary&graphId=4&key=interfaces/eth0/&start=now-12h&end=now";
$salida1 = get_headers($source1);
$salida2 = get_headers($source2);
?>
<table>
	<?php 
if (!preg_match("/Not Found/", $salida1[0]) && $salida1 != null) {
    ?>
	<tr>
		<td>
		<iframe frameborder="0" src="<?php 
    echo $source1;
    ?>
" width="400" height="250"></iframe>