Пример #1
0
function event_max_occurrences($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");
    ?>
        <table align="center" width="100%" cellpadding="0" cellspacing="0" class="noborder">
            <tr><td class="headerpr">
        <?php 
    if ($report_type == "alarm") {
        ?>
        <?php 
        echo _("Top");
        ?>
 <?php 
        echo "{$NUM_HOSTS} " . _("Alarms");
        ?>
        <?php 
    } else {
        ?>
        <?php 
        echo _("Top");
        ?>
 <?php 
        echo "{$NUM_HOSTS} " . _("Events");
        ?>
        <?php 
    }
    ?>
            </td></tr>
        </table>
        <table align="center" width="100%">
          <tr>
            <?php 
    if ($report_type == "alarm") {
        ?>
            <th> <?php 
        echo gettext("Alarm");
        ?>
 </th>
            <?php 
    } else {
        ?>
            <th> <?php 
        echo gettext("Event");
        ?>
 </th>
            <?php 
    }
    ?>
            <th> <?php 
    echo gettext("Occurrences");
    ?>
 </th>
          </tr>
<?php 
    $list = $security_report->Events($NUM_HOSTS, $report_type, $date_from, $date_to);
    foreach ($list as $l) {
        $event = $l[0];
        $short_event = SecurityReport::Truncate($event, 60);
        $occurrences = number_format($l[1], 0, ",", ".");
        ?>
          <tr>
             <?php 
        if ($report_type == "alarm") {
            $link = "{$ossim_link}/control_panel/alarm_console.php";
        } else {
            $link = "{$acid_link}/" . $acid_prefix . "_qry_main.php?new=1&" . "sig[0]==&" . "sig[1]=" . urlencode($event) . "&" . "sig[2]==&" . "submit=Query+DB&" . "num_result_rows=-1&" . "sort_order=time_d";
        }
        ?>
            <td style="text-align:left;"><a href="<?php 
        echo $link;
        ?>
"><?php 
        echo Util::signaturefilter($short_event);
        ?>
</a></td>
            <td><?php 
        echo $occurrences;
        ?>
</td>
          </tr>
<?php 
    }
    ?>
        <tr>
          <td colspan="2" class="nobborder" height="348" valign="top"><center>
            <br/>
<?php 
    if ($report_graph_type == "applets") {
        jgraph_nbevents_graph();
    } else {
        ?>
<iframe src="graphs/events_received_graph.php?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="<?php 
        echo _("events graph");
        ?>
"
        frameborder="0" style="margin:0px;padding:0px;width:430px;height:430px;border: 0px solid rgb(170, 170, 170);text-align:center"> </iframe><?php 
        /*
        ?>
                    <img src="graphs/events_received_graph.php?hosts=<?php
                echo $NUM_HOSTS
        ?>&type=<?php
                echo $report_type ?>&date_from=<?=urlencode($date_from)?>&date_to=<?=urlencode($date_to)?>" alt="events graph"/>
        <?php*/
    }
    ?>
          </center></td>
        <tr/>
        </table>
<?php 
}
Пример #2
0
        if (count($list) <= 30) {
            $font_size = 10;
        } else {
            $font_size = 8;
        }
    }
    foreach ($list as $l) {
        $event = $l[0];
        $occurrences = number_format($l[1], 0, ',', '.');
        $link = "{$ossim_link}/alarm/alarm_console.php";
        $bc = $c++ % 2 != 0 ? "class='par'" : '';
        $htmlPdfReport->set('
                                    <tr ' . $bc . '>
                                        <td style="text-align:left;width:60mm;font-size:' . $font_size . 'px">' . Util::wordwrap(Util::htmlentities(Util::signaturefilter($event)), 30, ' ', TRUE) . '</td>
                                        <td style="text-align:center;width:22mm;font-size:' . $font_size . 'px">' . $occurrences . '</td>
                                    </tr>');
    }
    $htmlPdfReport->set('
                        </table>
                    </td>
                <td valign="top" style="text-align:center;padding-top:15px;">');
    if ($report_graph_type == 'applets') {
        jgraph_nbevents_graph();
    } else {
        $htmlPdfReport->set('<img src="' . $htmlPdfReport->newImage('/report/graphs/events_received_graph.php?shared=' . urlencode($shared_file) . '&hosts=' . $num_hosts . '&type=' . $report_type . '&date_from=' . urlencode($date_from) . '&date_to=' . urlencode($date_to) . '&runorder=' . $runorder, 'png') . '" />');
    }
    $htmlPdfReport->set('
                </td>
            </tr>
        </table><br/><br/>');
}
Пример #3
0
function event_max_occurrences($date_from, $date_to)
{
    global $NUM_HOSTS;
    global $security_report;
    global $report_type;
    /* ossim framework conf */
    $conf = $GLOBALS['CONF'];
    $report_graph_type = $conf->get_conf('report_graph_type');
    $list = $security_report->Events($NUM_HOSTS, $report_type, $date_from, $date_to);
    if (!is_array($list) || empty($list)) {
        return 0;
    }
    ?>
    <table class='t_alarms'>
        <thead>
            <tr>
                <td class="headerpr">
                <?php 
    if ($report_type == "alarm") {
        echo _("Top") . " " . $NUM_HOSTS . " " . _("Alarms");
    } else {
        echo _("Top") . " " . $NUM_HOSTS . " " . _("Events");
    }
    ?>
                </td>
            </tr>
        </thead>
        
        <tbody>     
            <tr>
                <td class='td_container'>
                    <table class='table_data'>
                        <thead>
                            <tr>
                                <?php 
    if ($report_type == "alarm") {
        ?>
                                    <th> <?php 
        echo gettext("Alarm");
        ?>
 </th>
                                    <?php 
    } else {
        ?>
                                    <th> <?php 
        echo gettext("Event");
        ?>
 </th>
                                    <?php 
    }
    ?>
                                <th><?php 
    echo gettext("Occurrences");
    ?>
 </th>
                            </tr>
                        </thead>
                        
                        <tbody>
                            <?php 
    foreach ($list as $l) {
        $event = $l[0];
        $occurrences = number_format($l[1], 0, ",", ".");
        ?>
                                <tr>                
                                    <td class='left td_data'><?php 
        echo Util::signaturefilter($event);
        ?>
</td>
                                    <td class='center td_data'><?php 
        echo $occurrences;
        ?>
</td>
                                </tr>
                                <?php 
    }
    ?>
                            
                        </tbody>
                    </table>
             </td>
         </tr>
         <tr>
            <td class='center transparent'>
                
                <?php 
    if ($report_graph_type == "applets") {
        jgraph_nbevents_graph();
    } else {
        ?>
                        <iframe scrolling="no" src="graphs/events_received_graph.php?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="<?php 
        echo _("Events graph");
        ?>
" frameborder="0" style="margin:0px;padding:0px;width:430px;height:300px;border: 0px solid rgb(170, 170, 170);text-align:center"> </iframe><?php 
    }
    ?>
                  
            </td>
        </tr>
     </tbody>
    </table>
    <?php 
    return 1;
}