示例#1
0
function statsEventSensor()
{
    global $DEBUG;
    if ($DEBUG) {
        global $debugInfo;
        $debugCount = count($debugInfo[__FUNCTION__]);
        $starttime = microtime(true);
    }
    global $filterIndexHint;
    $filterType = 'filter';
    // Query for events
    $selector = 'SELECT COUNT(events.sensor_id) AS sensor_count, events.sensor_id as sensor_id FROM date_range, events ';
    if (count($_SESSION['filterIndexHint']) > 0 and $_SESSION['filterIndexHint'] != false) {
        $selector = $selector . 'USE INDEX ' . $filterIndexHint;
    }
    // SQL Query trailer
    $trailer = ' GROUP BY events.sensor_id ORDER BY sensor_count DESC';
    // Call superFilter to count filtered events
    $statsEventSensor = superFilter($selector, $trailer, $filterType, FALSE);
    $eventCount = count($statsEventSensor);
    for ($a = 0; $a < $eventCount; ++$a) {
        $sensor_name = getSensorName($statsEventSensor[$a]['sensor_id']);
        $statsEventSensor[$a]['sensor_name'] = $sensor_name['name'];
        $statsEventSensor[$a]['result'] = true;
    }
    foreach ($statsEventSensor as $f_statusSensor) {
        $f_statsEventSensorTotal = $f_statsEventSensorTotal + $f_statusSensor['sensor_count'];
    }
    $nextElement = count($statsEventSensor);
    foreach ($statsEventSensor as $key => $value) {
        $f_eventSensorPercent = round($value['sensor_count'] * 100 / $f_statsEventSensorTotal, 2);
        $statsEventSensor[$key]['sensor_percent'] = $f_eventSensorPercent;
        $value['sensor_percent'] = $f_eventSensorPercent;
        if ($f_eventSensorPercent < 5 and $nextElement > 7) {
            // make status less then 5% aggregated on 'others' when more that 7 sensors are in result
            $others = $others + $value['sensor_count'];
            $statsEventSensor[$nextElement]['sensor_count'] = $statsEventSensor[$nextElement]['sensor_count'] + $value['sensor_count'];
            $statsEventSensor[$nextElement]['sensor_name'] = 'Others';
            $statsEventSensor[$nextElement]['result'] = true;
            $statsEventSensor[$nextElement]['sensor_percent'] = $statsEventSensor[$nextElement]['sensor_percent'] + $value['sensor_percent'];
            unset($statsEventSensor[$key]);
        }
    }
    if ($DEBUG) {
        $stoptime = microtime(true);
        $timespend = $stoptime - $starttime;
        $debugInfo[__FUNCTION__][$debugCount]['time'] = $timespend;
    }
    return $statsEventSensor;
}
示例#2
0
	<table cellpadding="0" cellspacing="0" border="0">
	<tr>
   <td valign="top"><strong>Transaction ID&nbsp;</strong></td>
	<td><strong>
   <?php 
print $event_detail['event_id'];
?>
       
   </strong></td>
	</tr>

	<tr>
	<td valign="top">Sensor</td>
   <td>
   <?php 
$sensor = getSensorName($event_detail['sensor_id']);
print "<div title=\"" . $sensor['description'] . "\"><a href=\"events.php?src_sensor=" . headerprintnobr($event_detail['sensor_id']) . "\" title=\"Filter by this Sensor\">" . $sensor['name'] . "</a></div>";
?>
   
   </td>
	</tr>
	
	<tr>
	<td valign="top">Unique ID</td>
	<td>
   <?php 
print headerprintnobr($event_detail['a_uniqid']);
?>
   
   </td>
	</tr>
 /**
  * Liefert die Beschreibung für eine Sensor-Status-Bedingung
  * (Type 2) 
  */
 private function getDescriptionForSensorStatus()
 {
     return "Sensor: " . getSensorName($this->getSensorId()) . ": " . ($this->getStatus() == "J" ? "Aktiv" : "Inaktiv");
 }
示例#4
0
 // Edit a sensor
 ?>
 
 <script>
     function toggleStatus(){
         if ($('#clientIPinHeader').is(':checked')) {
             $('#clientIPHeader').removeAttr('disabled','disabled');
         } else{
             $('#clientIPHeader').attr('disabled',"");            
         };
     };
 </script>
 
 <?php 
 if (isset($_GET['edit']) and $sensorToEdit = @sanitize_int($_GET['sensor'], $min = '0')) {
     $sensor = getSensorName($sensorToEdit);
     $sensorType = sensorsType();
     if ($sensor['IP'] == null) {
         $sensor['IP'] = "Any";
     }
     print "<form method=\"POST\" action=\"management.php?s\">";
     print "<table>";
     print "<tr>";
     print "<td width=\"100\">ID</td><td width=\"230\">{$sensorToEdit} <input type=\"hidden\" name=\"Sensor\" value=\"{$sensorToEdit}\"></td><td width=\"450\"></td>";
     print "</tr><tr>";
     print "<td>Sensor</td><td><input type=\"text\" name=\"Name\" value=\"" . $sensor['name'] . "\" style=\"width: 195px\"></td><td> (Min. 5 - Max. 30 characters)</td>";
     print "</tr><tr>";
     print "<td>Password</td><td><input type=\"text\" name=\"Pass\" value=\"" . $sensor['password'] . "\" style=\"width: 195px\"></td><td> (Min. 5 - Max. 20 characters)</td>";
     print "</tr><tr>";
     print "<td>IP</td><td><input type=\"text\" name=\"IP\" value=\"" . $sensor['IP'] . "\" style=\"width: 195px\"></td><td> (empty|0.0.0.0 = Any, OR a host IP OR, a network range in CIDR)</td>";
     print "</tr><tr>";
示例#5
0
 print "<tr>";
 print "<td><input type=\"checkbox\" value=\"" . headerprintnobr($event['event_id']) . "\" name=\"event[]\" id=\"event\"/></td>";
 $severitytext = $severity[$event['h_severity']];
 print "<td><a href=\"eventview.php?e=" . headerprintnobr($event['event_id']) . "\" title=\"Show events details\">Details</a></td>";
 if ($event['h_action_status'] < 10) {
     $h_action_text = "Blocked";
     print "<td>\n                      <a href=\"events.php?actionstatus=" . headerprintnobr($event['h_action_status']) . "\" title=\"Filter by action: " . headerprintnobr($h_action_text) . "\">\n                      <img src=\"images/block.png\" alt=\"{$h_action_text} (" . headerprintnobr($event['h_action_status']) . ")\" style=\"border-style: none\" />\n                      </a>\n                      </td>";
 } elseif ($event['h_action_status'] < 20) {
     $h_action_text = "Allowed";
     print "<td>\n                      <a href=\"events.php?actionstatus=" . headerprintnobr($event['h_action_status']) . "\" title=\"Filter by action: {$h_action_text}\">\n                      <img src=\"images/allow.png\" alt=\"{$h_action_text} (" . headerprintnobr($event['h_action_status']) . ")\" style=\"border-style: none\" />\n                      </a>\n                      </td>";
 } elseif ($event['h_action_status'] >= 20) {
     $h_action_text = "Passed/Detection Only";
     print "<td>\n                      <a href=\"events.php?actionstatus=" . $event['h_action_status'] . "\" title=\"Filter by action: {$h_action_text}\">\n                      <img src=\"images/warning.png\" alt=\"{$h_action_text} (" . headerprintnobr($event['h_action_status']) . ")\" style=\"border-style: none\" />\n                      </a>\n                      </td>";
 }
 print "<td>";
 $sensor = getSensorName($event['sensor_id']);
 print "<div title=\"Click to filter by sensor " . headerprintnobr($sensor['name']) . ": " . headerprintnobr($sensor['description']) . "\"><a href=\"events.php?src_sensor=" . headerprintnobr($event['sensor_id']) . "\" > " . headerprintnobr($sensor['name']) . " </a>  <br> </div>";
 print "</td>";
 print "<td><a href=\"events.php?severity=" . headerprintnobr($event['h_severity']) . "\">\n                   <img src=\"images/" . headerprintnobr($event['h_severity']) . ".png\" style=\"border-style: none\" title=\"Click to filter by severity: " . headerprintnobr($severitytext) . "\" alt=\"Click to filter by severity: " . headerprintnobr($severitytext) . "\" /></a></td>";
 print "<td>" . headerprintnobr($event['a_timestamp']) . "</td>";
 print "<td>\n                   <a href=\"events.php?esrc=" . headerprintnobr($event['a_client_ip']) . "\" title=\"Click to filter by this IP\">\n                   " . $event['a_client_ip'] . " </a>\n                   " . $event['a_client_port'] . "\n                   </td>";
 if ($event['b_host'] != '') {
     print "<td><div class=\"wordwrap\">Hostname: <a href=\"events.php?web_Hostname=" . headerprintnobr($event['b_host']) . "\" title=\"Click to filter by this Web Hostname\">" . headerprintnobr(getWebHostName($event['b_host'])) . "</a>, ";
 } else {
     print "<td>Hostname: N/A, ";
 }
 print "Port: " . headerprintnobr($event['a_server_port']) . ", <br />\n                      Method: <a href=\"events.php?method=" . headerprintnobr($event['b_method']) . "\" title=\"Click to filter by this method\">" . $event['b_method'] . "</a>,\n                      Path: <a href=\"events.php?path=" . headerprintnobr($event['b_path']) . "\" title=\"Click to filter by this Path\">" . headerprintnobr($event['b_path']) . "</a>";
 if ($event['b_path_parameter'] != "") {
     print "?" . headerprintnobr($event['b_path_parameter']);
 }
 print "<br />Status Code: <a href=\"events.php?http_Status=" . headerprintnobr($event['f_status']) . "\" title=\"Click to filter by this HTTP Status\">" . headerprintnobr($event['f_status']) . "</a> ";
示例#6
0
<?php 
require_once "../functions.php";
global $DEBUG;
if ($DEBUG) {
    $starttime_main = microtime(true);
}
$pagId = 'wizardfeeder';
require_once "../session.php";
require_once "../header.php";
?>
<div id="page-wrap">
   <div id="main-content">

    <?php 
if (isset($_GET['sensor']) and @sanitize_int($_GET['sensor'], $min = '0') and $sensorDetail = getSensorName($_GET['sensor'])) {
    // Sensors Tasks
    $sensor = $_GET['sensor'];
    if (isset($_GET['wiz']) and $_GET['wiz'] == "Next" and isset($_GET['sensor']) and isset($_GET['feeder']) and ($_GET['feeder'] == "mlogc" or $_GET['feeder'] = "mlog2waffle") and isset($_GET['usage']) and ($_GET['usage'] == "piped" or $_GET['usage'] == "scheduled" and isset($_GET['logfile']) or $_GET['usage'] == "service" and isset($_GET['logfile'])) and isset($_GET['address']) and isset($_GET['logdir'])) {
        // Show config template
        $feeder = $_GET['feeder'];
        $usage = $_GET['usage'];
        ?>
            
            <div id="management_menu">
             <p>
             
             <h3>Templates generated for:</h3><br>
             <?php 
        print "<b>Sensor:</b> " . headerprintnobr($sensorDetail['name']) . " <br />";
        print "<b>Feeder:</b> " . headerprintnobr($feeder) . " <br />";