[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ossec-cvs] ossec-hids: eventSummary.php (HEAD) [davelowe]
- To: ossec-cvs@xxxxxxxxx
- Subject: [ossec-cvs] ossec-hids: eventSummary.php (HEAD) [davelowe]
- From: OSSEC CVS <cvs-commit@xxxxxxxxx>
- Date: Thu, 19 Jul 2007 00:22:48 -0300 (ADT)
- Content-transfer-encoding: 8bit
Module name: ossec-hids
Changes by: davelowe 07/07/19 00:22:46
Modified files:
eventSummary.php
Log message:
Description: Lib to retrieve alerts
Reviewed by: DL
Bug: Added the ability to specify a hostname when getting alerts
Index: eventSummary.php
===================================================================
RCS file: /usr/cvsroot/ossec-ui/ossec/Site/eventSummary.php,v
diff -u -r1.6 -r1.7
--- eventSummary.php 18 Jul 2007 05:02:47 -0000 1.6
+++ eventSummary.php 19 Jul 2007 03:22:46 -0000 1.7
@@ -13,16 +13,17 @@
{
$USER_host = $_GET['selectHost'];
if($USER_host == "All"){
- $USER_host = NULL;
+ $USER_host = "*";
}
}
else
{
- $USER_host = NULL;
+ /* preg match all hosts */
+ $USER_host = "*";
}
/* Getting last alerts */
-$alert_list = os_getalerts($ossec_handle, 0, 0, 30);
+$alert_list = os_getalerts($ossec_handle, 0, 0, 30,$USER_host);
if($alert_list == NULL)
{
echo "<b>Unable to retrieve alerts. </b><br />\n";
@@ -43,41 +44,36 @@
<td class="ttd"></td>
</tr>
';
-
- foreach ($agent_list as $agent)
+ $evt_count = sizeof($alert_list) -1;
+ while($evt_count >= 0)
{
- $evt_count = sizeof($alert_list) -1;
- while($evt_count >= 0)
+ $alert = $alert_list[$evt_count];
+ $al_date = date('Y M d H:i:s', $alert{'time'});
+ /* Pump out the alert information */
+ echo "<tr>\n";
+ /* Location */
+ echo "<td class=\"ttd\">".$alert{'location'}."</td>\n";
+ /* Date */
+ echo "<td class=\"ttd\">".$al_date."</td>\n";
+ /* Alert ID */
+ echo "<td align=center class=\"ttd\">".$alert{'id'}."</td>\n";
+ /* Alert Level */
+ echo "<td align=center class=\"ttd\">".$alert{'level'}."</td>\n";
+ /* Alert Description */
+ echo "<td class=\"ttd\">".$alert{'description'}."</td> \n";
+ /* Link to alert Details */
+ echo "<td width=20 class=\"ttd\"><div onclick=showEventDetails('".$evt_count."','layerDetails'); class=\"details\">More</div>";
+ /* Alert Details in Hidden element */
+ echo "<div id=\"".$evt_count."\" style=\"visibility: hidden; position: absolute;\">";
+ foreach($alert{'msg'} as $alert_msg)
{
- $alert = $alert_list[$evt_count];
- $al_date = date('Y M d H:i:s', $alert{'time'});
- /* Pump out the alert information */
- echo "<tr>\n";
- /* Location */
- echo "<td class=\"ttd\">".$alert{'location'}."</td>\n";
- /* Date */
- echo "<td class=\"ttd\">".$al_date."</td>\n";
- /* Alert ID */
- echo "<td align=center class=\"ttd\">".$alert{'id'}."</td>\n";
- /* Alert Level */
- echo "<td align=center class=\"ttd\">".$alert{'level'}."</td>\n";
- /* Alert Description */
- echo "<td class=\"ttd\">".$alert{'description'}."</td> \n";
- /* Link to alert Details */
- echo "<td width=20 class=\"ttd\"><div onclick=showEventDetails('".$evt_count."','layerDetails'); class=\"details\">More</div>";
- /* Alert Details in Hidden element */
- echo "<div id=\"".$evt_count."\" style=\"visibility: hidden; position: absolute;\">";
- foreach($alert{'msg'} as $alert_msg)
- {
- if($alert_msg == NULL)
- break;
- echo $alert_msg;
- }
- echo "</div></td>\n</tr>\n";
- /* End Alert Details in Hidden Element */
- /* END ALERT */
- $evt_count--;
+ if($alert_msg == NULL) break;
+ echo $alert_msg;
}
+ echo "</div></td>\n</tr>\n";
+ /* End Alert Details in Hidden Element */
+ /* END ALERT */
+ $evt_count--;
}
echo "</table>\n";
}
OSSEC home |
Main Index |
Thread Index
OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.