diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-09-27 17:20:28 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-09-27 17:20:28 +0000 |
commit | 9734abbbcad66c504e29ad14a498e0fd66eef5b1 (patch) | |
tree | c0866e4b8505626ca48f61a38f4b551dc134bdc2 /packages/snort | |
parent | af7dce4fad954900886ec5223ddee31d9c6dad46 (diff) | |
download | pfsense-packages-9734abbbcad66c504e29ad14a498e0fd66eef5b1.tar.gz pfsense-packages-9734abbbcad66c504e29ad14a498e0fd66eef5b1.tar.bz2 pfsense-packages-9734abbbcad66c504e29ad14a498e0fd66eef5b1.zip |
General cleanups. File is usable now.
Diffstat (limited to 'packages/snort')
-rw-r--r-- | packages/snort/snort_alerts.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/packages/snort/snort_alerts.php b/packages/snort/snort_alerts.php index 536cb0f7..881a4c83 100644 --- a/packages/snort/snort_alerts.php +++ b/packages/snort/snort_alerts.php @@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. */ +require("globals.inc"); require("guiconfig.inc"); $snort_logfile = "{$g['varlog_path']}/snort/alert"; @@ -73,8 +74,8 @@ include("head.inc"); <td colspan="2" class="listtopic"> Last <?=$nentries;?> Snort Alert entries</td> </tr> - <?php dump_clog($snort_logfile, $nentries); ?> - <tr><td><br><form action="diag_logs_slbd.php" method="post"> + <?php dump_log_file($snort_logfile, $nentries); ?> + <tr><td><br><form action="snort_alerts.php" method="post"> <input name="clear" type="submit" class="formbtn" value="Clear log"></td></tr> </table> </div> @@ -86,3 +87,21 @@ include("head.inc"); <meta http-equiv="refresh" content="60;url=<?php print $_SERVER['SCRIPT_NAME']; ?>"> </body> </html> +<!-- <?php echo $snort_logfile; ?> --> + +<?php + +function dump_log_file($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") { + global $g, $config; + $logarr = ""; + exec("cat {$logfile} | /usr/bin/tail -n {$tail}", $logarr); + foreach ($logarr as $logent) { + if(!logent) + continue; + echo "<tr valign=\"top\">\n"; + echo "<td colspan=\"2\" class=\"listr\">" . $logent . " </td>\n"; + echo "</tr>\n"; + } +} + +?>
\ No newline at end of file |