Little bug in event log
Hi!
I just noticed these entries in my event log after moving a server from one datacenter to another:
16s eth0 IPv6 removed: 2001:9e0:803::30/64 16s eth0 IPv6 removed: 2001:9e0:803::30/64 16s eth0 IPv6 added: 2001:9e0:803::30/64 16s eth0 IPv6 added: 2001:9e0:803::29/64 16s eth0 IPv4 removed: 94.142.242.217/28 16s eth0 IPv4 removed: 94.142.242.210/28 16s eth0 IPv4 added: 83.247.10.30/27 16s eth0 IPv4 added: 83.247.10.29/27
As you can see the IPv4 added and removed lines make sense: remove two addresses from 94.142.242.x/28 and add two addresses in 83.247.10.x/27. The IPv6 addresses are wrong though: It *should* have logged two removals from 2a02:898:148::x/64 and two adds in 2001:9e0:803::x/64, but it logs one of the newly added addresses as removed twice.
Here is a diff to fix the bug:
--- includes/discovery/ipv6-addresses.inc.php 2015-02-06 18:00:03.498755071 +0100 +++ includes_fixed/discovery/ipv6-addresses.inc.php 2015-02-17 01:30:26.334861137 +0100 @@ -196,7 +196,7 @@ { // Delete IP dbDelete('ipv6_addresses', '`ipv6_address_id` = ?', array($entry['ipv6_address_id'])); - log_event("IPv6 removed: $full_compressed", $device, 'port', $port_id); + log_event("IPv6 removed: $full_address", $device, 'port', $port_id); echo('-'); $check_networks[$entry['ipv6_network_id']] = 1; }
Cheers! Sander
Hi,
thanks, fixed in r6287.
On 17.02.2015 03:31, Sander Steffann wrote:
Hi!
I just noticed these entries in my event log after moving a server from one datacenter to another:
16s eth0 IPv6 removed: 2001:9e0:803::30/64 16s eth0 IPv6 removed: 2001:9e0:803::30/64 16s eth0 IPv6 added: 2001:9e0:803::30/64 16s eth0 IPv6 added: 2001:9e0:803::29/64 16s eth0 IPv4 removed: 94.142.242.217/28 16s eth0 IPv4 removed: 94.142.242.210/28 16s eth0 IPv4 added: 83.247.10.30/27 16s eth0 IPv4 added: 83.247.10.29/27
As you can see the IPv4 added and removed lines make sense: remove two addresses from 94.142.242.x/28 and add two addresses in 83.247.10.x/27. The IPv6 addresses are wrong though: It *should* have logged two removals from 2a02:898:148::x/64 and two adds in 2001:9e0:803::x/64, but it logs one of the newly added addresses as removed twice.
Here is a diff to fix the bug:
--- includes/discovery/ipv6-addresses.inc.php 2015-02-06 18:00:03.498755071 +0100 +++ includes_fixed/discovery/ipv6-addresses.inc.php 2015-02-17 01:30:26.334861137 +0100 @@ -196,7 +196,7 @@ { // Delete IP dbDelete('ipv6_addresses', '`ipv6_address_id` = ?', array($entry['ipv6_address_id']));
- log_event("IPv6 removed: $full_compressed", $device, 'port', $port_id);
- log_event("IPv6 removed: $full_address", $device, 'port', $port_id); echo('-'); $check_networks[$entry['ipv6_network_id']] = 1; }
Cheers! Sander
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (2)
-
Mike Stupalov
-
Sander Steffann