Skip to content

Commit

Permalink
Fix possible null error in SLA modules (librenms#13046)
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant authored Jul 16, 2021
1 parent fb6da83 commit ca621fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LibreNMS/OS/Shared/Cisco.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function discoverSlas()
'sla_nr' => $index,
'owner' => $sla_config['rttMonCtrlAdminOwner'] ?? '',
'tag' => $this->getSlaTag($sla_config),
'rtt_type' => $sla_config['rttMonCtrlAdminRttType'],
'rtt_type' => $sla_config['rttMonCtrlAdminRttType'] ?? '',
'rtt' => $sla_config['rttMonLatestRttOperCompletionTime'] ?? null,
'status' => ($sla_config['rttMonCtrlAdminStatus'] == 'active') ? 1 : 0,
'opstatus' => ($sla_config['rttMonLatestRttOperSense'] == 'ok') ? 0 : 2,
Expand Down
2 changes: 1 addition & 1 deletion LibreNMS/OS/Vrp.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ public function discoverSlas()
'sla_nr' => hexdec(hash('crc32', $owner . $test)), // indexed by owner+test, convert to int
'owner' => $owner,
'tag' => $test,
'rtt_type' => $sla_config['nqaAdminCtrlType'],
'rtt_type' => $sla_config['nqaAdminCtrlType'] ?? '',
'rtt' => isset($sla_config['pingResultsAverageRtt']) ? $sla_config['pingResultsAverageRtt'] / 1000 : null,
'status' => ($sla_config['pingCtlAdminStatus'] == 'enabled') ? 1 : 0,
'opstatus' => ($sla_config['pingCtlRowStatus'] == 'active') ? 0 : 2,
Expand Down

0 comments on commit ca621fb

Please sign in to comment.