mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
patch from jduggan to detect mac address changes
git-svn-id: http://www.observium.org/svn/observer/trunk@918 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -35,6 +35,12 @@
|
||||
$mac_table[$interface_id][$clean_mac] = 1;
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) from ipv4_mac WHERE interface_id = '".$interface['interface_id']."' AND ipv4_address = '$ip'"),0)) {
|
||||
$sql = "UPDATE `ipv4_mac` SET `mac_address` = '$clean_mac' WHERE interface_id = '".$interface['interface_id']."' AND ipv4_address = '$ip'";
|
||||
$old_mac = mysql_fetch_row(mysql_query("SELECT mac_address from ipv4_mac WHERE ipv4_address='$ip'"));
|
||||
if($clean_mac != $old_mac[0])
|
||||
{
|
||||
if ($debug) { echo "Changed mac address for $ip from $old_mac[0] to $clean_mac\n"; }
|
||||
log_event("MAC change: $ip : " . $old_mac[0] . " -> $clean_mac", $device, "interface", $interface['interface_id']);
|
||||
}
|
||||
mysql_query($sql);
|
||||
echo(".");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user