From 8d58afa8470e67d59be7e8e6be3f7344bb2b3e15 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 8 Aug 2015 13:03:41 +0200 Subject: arpwatch - code style cleanup - Fix copyright header - Fix nanobsd - Code style - Fix XHTML --- config/arpwatch/arpwatch_reports.php | 132 +++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 62 deletions(-) (limited to 'config/arpwatch') diff --git a/config/arpwatch/arpwatch_reports.php b/config/arpwatch/arpwatch_reports.php index 9b3b1c6c..c1ab376f 100755 --- a/config/arpwatch/arpwatch_reports.php +++ b/config/arpwatch/arpwatch_reports.php @@ -1,61 +1,65 @@ #!/usr/local/bin/php $newmac, - "timestamp" => trim($todo[2]), - "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown" - ); + $report[$todo[1]][] = array( + "mac" => $newmac, + "timestamp" => trim($todo[2]), + "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown" + ); unset($mac); } } + $pgtitle = "arpwatch: Reports"; include("head.inc"); @@ -64,23 +68,23 @@ include("head.inc"); - - + - - - +
+
-
-
- - - - + + + + - + + + +
arp.dat entries
+
+ + + + @@ -88,14 +92,14 @@ include("head.inc"); $rawentries) { + if ($report) { + foreach ($report as $ip => $rawentries) { $printip = true; $entries = $rawentries; sort($entries); - foreach($entries as $entry) { + foreach ($entries as $entry) { echo ''; - if($printip) { + if ($printip) { echo ''; $stampclass = "listr"; $printip = false; @@ -111,17 +115,21 @@ include("head.inc"); echo ''; } } + } ?> - - - -
arp.dat entries
IP TimestampHostname
' . $ip . '
-
-
- -
-
-
-
+
+
+ +
+
+
+
+ + + -- cgit v1.2.3