Add OUI Vendor to excessive requests data

This commit is contained in:
Akkadius 2017-09-21 13:23:35 -05:00
parent bad5989601
commit f9dec38ad9
4 changed files with 39 additions and 28 deletions

View File

@ -7,7 +7,7 @@ router.get('/', function(req, res, next) {
var stat_data = dhcp_requests; var stat_data = dhcp_requests;
for (var key in stat_data) { for (var key in stat_data) {
if(stat_data[key].request_count <= 100) if(stat_data[key].request_count <= 10)
delete stat_data[key]; delete stat_data[key];
} }

9
app.js
View File

@ -317,6 +317,15 @@ tail_dhcp_log.on("line", function(data) {
if (typeof dhcp_requests[request_from].request_count === "undefined") if (typeof dhcp_requests[request_from].request_count === "undefined")
dhcp_requests[request_from].request_count = 0; dhcp_requests[request_from].request_count = 0;
if (typeof request_from !== "undefined") {
if (request_from.length == 17 && /:/.test(request_from)) {
var mac_oui = request_from.split(":").join("").toUpperCase().slice(0, 6);
if (typeof dhcp_requests[request_from].request_vendor === "undefined")
dhcp_requests[request_from].request_vendor = oui_data[mac_oui];
}
}
dhcp_requests[request_from].request_count++; dhcp_requests[request_from].request_count++;
} }
}); });

View File

@ -22,14 +22,15 @@
<div class="card hide_me"> <div class="card hide_me">
<div class="header"> <div class="header">
<h2>Excessive DHCP Requests</h2> <h2>Excessive DHCP Requests (10 Minute Interval)</h2>
</div> </div>
<div class="body"> <div class="body">
<small>Usually indicative of a physical error on the network with one-way communication</small> <small>Usually indicative of a physical error on the network with one-way communication</small><br><br>
<table id="excessive_requests" class="table table-bordered table-striped table-hover js-basic-example dataTable dashboard-task-infos"> <table id="excessive_requests" class="table table-bordered table-striped table-hover js-basic-example dataTable dashboard-task-infos">
<thead> <thead>
<tr> <tr>
<th>MAC</th> <th>MAC</th>
<th>Vendor</th>
<th>Requesting IP</th> <th>Requesting IP</th>
<th>Request Via</th> <th>Request Via</th>
<th>Count</th> <th>Count</th>
@ -137,6 +138,7 @@
$.each(data, function(k, v) { $.each(data, function(k, v) {
$('#excessive_requests > tbody:last-child').append('<tr>' + $('#excessive_requests > tbody:last-child').append('<tr>' +
'<td>' + k + '</td>' + '<td>' + k + '</td>' +
'<td>' + data[k].request_vendor + '</td>' +
'<td>' + data[k].request_for + '</td>' + '<td>' + data[k].request_for + '</td>' +
'<td>' + data[k].request_via + '</td>' + '<td>' + data[k].request_via + '</td>' +
'<td>' + data[k].request_count.toLocaleString('en') + '</td>' + '<td>' + data[k].request_count.toLocaleString('en') + '</td>' +
@ -150,7 +152,7 @@
responsive: true, responsive: true,
"pageLength": 20, "pageLength": 20,
"aaSorting": [], "aaSorting": [],
"order": [[ 3, "desc" ]] "order": [[ 4, "desc" ]]
}); });
// $('table').fadeIn(100); // $('table').fadeIn(100);

View File