-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharuba_radar.php
55 lines (46 loc) · 1.5 KB
/
aruba_radar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
if (!isset($_POST["input"])) {
echo "<form action='aruba_radar.php' method='post'><textarea name='input'></textarea><input type='submit' value='OK' /></form>";
}
else {
$total = 0;
$aps = array();
$channels = array();
$type_id = array();
$hours = array();
$tmp = explode("\n",$_POST["input"]);
foreach ($tmp as $line) {
if (preg_match("/([0-9]+)(\:)([0-9]+)(\:)([0-9]+)(.+)(\|AP )((.+))(\@)(.+)(Radar detected on interface wifi0\, channel )([0-9]+)(\, typeid )([0-9]+)/i", $line, $out)) {
$total++;
$aps[$out[8]]++;
$channels[$out[13]]++;
$type_id[$out[15]]++;
$hours[$out[1]]++;
}
}
echo "<h1>Total</h1>" . $total . "<br />";
arsort($aps);
arsort($channels);
arsort($type_id);
arsort($hours);
echo "<h1>AP's</h1><table><col width='200' />";
foreach ($aps as $field => $count) {
echo "<tr><td>{$field}</td><td>{$count}</td></tr>";
}
echo "</table>";
echo "<h1>Channels</h1><table><col width='200' />";
foreach ($channels as $field => $count) {
echo "<tr><td>{$field}</td><td>{$count}</td></tr>";
}
echo "</table>";
echo "<h1>Typeid's</h1><table><col width='200' />";
foreach ($type_id as $field => $count) {
echo "<tr><td>{$field}</td><td>{$count}</td></tr>";
}
echo "</table>";
echo "<h1>Hours</h1><table><col width='200' />";
foreach ($hours as $hour => $count) {
echo "<tr><td>{$hour}</td><td>{$count}</td></tr>";
}
echo "</table>";
}