Skip to content

Commit

Permalink
Fix bug in sysContacts email collection
Browse files Browse the repository at this point in the history
Also, include trace in log when an error occurs
  • Loading branch information
murrant committed Sep 15, 2023
1 parent 7bbe0a2 commit f507ac6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LibreNMS/Alert/AlertUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function findContactsSysContact(array $results): array
$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;
Expand Down
2 changes: 1 addition & 1 deletion LibreNMS/Alert/RunAlerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public function extTransports($obj)
$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']);
Expand Down

0 comments on commit f507ac6

Please sign in to comment.