Respect ignore_interfaces and i_ignore when detecting wrapped device uptime
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
2.017001 -
|
2.017001 -
|
||||||
|
|
||||||
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
* Respect ignore_interfaces and i_ignore when detecting wrapped device uptime
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
* Update NodeWireless entries which match both MAC and SSID found, only
|
* Update NodeWireless entries which match both MAC and SSID found, only
|
||||||
|
|||||||
@@ -190,11 +190,8 @@ sub store_interfaces {
|
|||||||
# clear the cached uptime and get a new one
|
# clear the cached uptime and get a new one
|
||||||
my $dev_uptime = $snmp->load_uptime;
|
my $dev_uptime = $snmp->load_uptime;
|
||||||
|
|
||||||
if (scalar grep {$_ > $dev_uptime} values %$i_lastchange) {
|
# used to track whether we've wrapped the device uptime
|
||||||
info sprintf ' [%s] interfaces - device uptime has wrapped - correcting',
|
my $dev_uptime_wrapped = 0;
|
||||||
$device->ip;
|
|
||||||
$device->uptime( $dev_uptime + 2**32 );
|
|
||||||
}
|
|
||||||
|
|
||||||
# build device interfaces suitable for DBIC
|
# build device interfaces suitable for DBIC
|
||||||
my %interfaces;
|
my %interfaces;
|
||||||
@@ -220,6 +217,13 @@ sub store_interfaces {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (not $dev_uptime_wrapped and $i_lastchange->{$entry} > $dev_uptime) {
|
||||||
|
info sprintf ' [%s] interfaces - device uptime wrapped (%s) - correcting',
|
||||||
|
$device->ip, $port;
|
||||||
|
$device->uptime( $dev_uptime + 2**32 );
|
||||||
|
$dev_uptime_wrapped = 1;
|
||||||
|
}
|
||||||
|
|
||||||
my $lc = $i_lastchange->{$entry};
|
my $lc = $i_lastchange->{$entry};
|
||||||
if ($device->is_column_changed('uptime') and $lc) {
|
if ($device->is_column_changed('uptime') and $lc) {
|
||||||
if ($lc < $dev_uptime) {
|
if ($lc < $dev_uptime) {
|
||||||
|
|||||||
Reference in New Issue
Block a user