For address:idle show the correct days since the system was last seen, not the configuration
This commit is contained in:
parent
3852e69fcc
commit
a2cc1b6b8e
@ -53,6 +53,8 @@ class AddressIdle implements ShouldQueue
|
|||||||
$age = Carbon::now()->subDays(config('fido.idle.delist'));
|
$age = Carbon::now()->subDays(config('fido.idle.delist'));
|
||||||
|
|
||||||
foreach ($this->old($this->do,config('fido.idle.delist'),Address::NODE_DOWN,$this->ao) as $ao) {
|
foreach ($this->old($this->do,config('fido.idle.delist'),Address::NODE_DOWN,$this->ao) as $ao) {
|
||||||
|
Log::debug(sprintf('%s:- Evaluating DOWN node [%s], not seen for at least [%d] days, last update [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays(),$ao->updated_at->diffInDays()));
|
||||||
|
|
||||||
// Only delist system that has been marked down
|
// Only delist system that has been marked down
|
||||||
// Only delist them if its been 14 days since they were marked DOWN
|
// Only delist them if its been 14 days since they were marked DOWN
|
||||||
if ((! $ao->is_down) || ($ao->updated_at->greaterThan(Carbon::now()->subWeeks(2))))
|
if ((! $ao->is_down) || ($ao->updated_at->greaterThan(Carbon::now()->subWeeks(2))))
|
||||||
@ -62,7 +64,7 @@ class AddressIdle implements ShouldQueue
|
|||||||
if ($ao->system->last_seen && $ao->system->last_seen->greaterThan($age))
|
if ($ao->system->last_seen && $ao->system->last_seen->greaterThan($age))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Log::info(sprintf('%s:- Delisting [%s], not seen for at least [%d] days',self::LOGKEY,$ao->ftn,config('fido.idle.delist')));
|
Log::info(sprintf('%s:- Delisting [%s], not seen for at least [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays()));
|
||||||
$contact = FALSE;
|
$contact = FALSE;
|
||||||
|
|
||||||
// Remove echomail not collected from echomail_seenby
|
// Remove echomail not collected from echomail_seenby
|
||||||
@ -117,6 +119,8 @@ class AddressIdle implements ShouldQueue
|
|||||||
$age = Carbon::now()->subDays(config('fido.idle.down'));
|
$age = Carbon::now()->subDays(config('fido.idle.down'));
|
||||||
|
|
||||||
foreach ($this->old($this->do,config('fido.idle.down'),Address::NODE_HOLD,$this->ao) as $ao) {
|
foreach ($this->old($this->do,config('fido.idle.down'),Address::NODE_HOLD,$this->ao) as $ao) {
|
||||||
|
Log::debug(sprintf('%s:- Evaluating HOLD node [%s], not seen for at least [%d] days, last update [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays(),$ao->updated_at->diffInDays()));
|
||||||
|
|
||||||
// Only mark down system that has been marked down
|
// Only mark down system that has been marked down
|
||||||
// Only mark down them if its been 14 days since they were marked HOLD
|
// Only mark down them if its been 14 days since they were marked HOLD
|
||||||
if ((! $ao->is_hold) || ($ao->updated_at->greaterThan(Carbon::now()->subWeeks(2))))
|
if ((! $ao->is_hold) || ($ao->updated_at->greaterThan(Carbon::now()->subWeeks(2))))
|
||||||
@ -126,7 +130,7 @@ class AddressIdle implements ShouldQueue
|
|||||||
if ($ao->system->last_seen && $ao->system->last_seen->greaterThan($age))
|
if ($ao->system->last_seen && $ao->system->last_seen->greaterThan($age))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Log::info(sprintf('%s:- Marking [%s] as DOWN, not seen for at least [%d] days',self::LOGKEY,$ao->ftn,config('fido.idle.down')));
|
Log::info(sprintf('%s:- Marking [%s] as DOWN, not seen for at least [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays()));
|
||||||
$contact = FALSE;
|
$contact = FALSE;
|
||||||
|
|
||||||
// Email Alert
|
// Email Alert
|
||||||
@ -157,6 +161,8 @@ class AddressIdle implements ShouldQueue
|
|||||||
$age = Carbon::now()->subDays(config('fido.idle.hold'));
|
$age = Carbon::now()->subDays(config('fido.idle.hold'));
|
||||||
|
|
||||||
foreach ($this->old($this->do,config('fido.idle.hold'),Address::NODE_ALL,$this->ao) as $ao) {
|
foreach ($this->old($this->do,config('fido.idle.hold'),Address::NODE_ALL,$this->ao) as $ao) {
|
||||||
|
Log::debug(sprintf('%s:- Evaluating IDLE node [%s], not seen for at least [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays()));
|
||||||
|
|
||||||
// Ignore any systems that are a Discoverd System
|
// Ignore any systems that are a Discoverd System
|
||||||
if ($ao->system->name === System::default) {
|
if ($ao->system->name === System::default) {
|
||||||
Log::alert(sprintf('%s:! Ignoring HOLD for discovered System [%s]',self::LOGKEY,$ao->ftn));
|
Log::alert(sprintf('%s:! Ignoring HOLD for discovered System [%s]',self::LOGKEY,$ao->ftn));
|
||||||
@ -173,7 +179,7 @@ class AddressIdle implements ShouldQueue
|
|||||||
|
|
||||||
$contact = FALSE;
|
$contact = FALSE;
|
||||||
|
|
||||||
Log::info(sprintf('%s:- Marking [%s] as HOLD, not seen for at least [%d] days',self::LOGKEY,$ao->ftn,config('fido.idle.hold')));
|
Log::info(sprintf('%s:- Marking [%s] as HOLD, not seen for at least [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays()));
|
||||||
|
|
||||||
// Email Alert
|
// Email Alert
|
||||||
if ($ao->system->users->count()) {
|
if ($ao->system->users->count()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user