Fix for EMSI aborting with $rc undefined, Fix for idle nodes updates failing on updated_at column and change text used when nodes have never polled
This commit is contained in:
@@ -57,22 +57,30 @@ class AbsentNodes extends Echomails
|
||||
|
||||
$msg->addText("The following nodes have had their status changed, because they are absent from the network.\r\r");
|
||||
|
||||
// Nodes marked HOLD - will be marked down ...
|
||||
// Nodes marked HOLD
|
||||
if (($x=$this->aos->filter(fn($item)=>$item->active && ($item->role & Address::NODE_HOLD)))->count()) {
|
||||
$msg->addText("The following nodes have been marked HOLD:\r");
|
||||
|
||||
foreach ($x as $ao)
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
foreach ($x as $ao) {
|
||||
if (! $ao->system->last_seen)
|
||||
$msg->addText(sprintf('* %s (%s), not seen since registered %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->updated_at->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
else
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
}
|
||||
|
||||
$msg->addText("\r");
|
||||
}
|
||||
|
||||
// Nodes marked DOWN - will be delisted on...
|
||||
// Nodes marked DOWN
|
||||
if (($x=$this->aos->filter(fn($item)=>$item->active && ($item->role & Address::NODE_DOWN)))->count()) {
|
||||
$msg->addText("The following nodes have been marked DOWN:\r");
|
||||
|
||||
foreach ($x as $ao)
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
foreach ($x as $ao) {
|
||||
if (! $ao->system->last_seen)
|
||||
$msg->addText(sprintf('* %s (%s), not seen since registered %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->updated_at->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
else
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
}
|
||||
|
||||
$msg->addText("\r");
|
||||
}
|
||||
@@ -81,8 +89,12 @@ class AbsentNodes extends Echomails
|
||||
if (($x=$this->aos->filter(fn($item)=>! $item->active))->count()) {
|
||||
$msg->addText("The following nodes have been DE-LISTED:\r");
|
||||
|
||||
foreach ($x as $ao)
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
foreach ($x as $ao) {
|
||||
if (! $ao->system->last_seen)
|
||||
$msg->addText(sprintf('* %s (%s), not seen since registered %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->updated_at->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
else
|
||||
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_seen?->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
|
||||
}
|
||||
|
||||
$msg->addText("\r");
|
||||
}
|
||||
|
Reference in New Issue
Block a user