mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 02:48:37 +00:00
Fix bug in sysContacts email collection (#15325)
Also, include trace in log when an error occurs
This commit is contained in:
parent
4b98bd7607
commit
ba67d886c8
@ -156,7 +156,7 @@ class AlertUtil
|
||||
$contacts = [];
|
||||
|
||||
foreach ($results as $result) {
|
||||
$device = DeviceCache::get($result);
|
||||
$device = DeviceCache::get($result['device_id']);
|
||||
$email = $device->getAttrib('override_sysContact_bool')
|
||||
? $device->getAttrib('override_sysContact_string')
|
||||
: $device->sysContact;
|
||||
|
@ -511,7 +511,7 @@ class RunAlerts
|
||||
$tmp = $instance->deliverAlert($obj, $item['opts'] ?? []);
|
||||
$this->alertLog($tmp, $obj, $obj['transport']);
|
||||
} catch (AlertTransportDeliveryException $e) {
|
||||
Eventlog::log($e->getMessage(), $obj['device_id'], 'alert', Severity::Error);
|
||||
Eventlog::log($e->getTraceAsString() . PHP_EOL . $e->getMessage(), $obj['device_id'], 'alert', Severity::Error);
|
||||
$this->alertLog($e->getMessage(), $obj, $obj['transport']);
|
||||
} catch (\Exception $e) {
|
||||
$this->alertLog($e, $obj, $obj['transport']);
|
||||
|
Loading…
Reference in New Issue
Block a user