We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd575be commit 8a5a1b7Copy full SHA for 8a5a1b7
1 file changed
LibreNMS/Alert/RunAlerts.php
@@ -128,7 +128,12 @@ public function describeAlert($alert)
128
$obj['status'] = $device->status;
129
$obj['status_reason'] = $device->status_reason;
130
if (ConnectivityHelper::pingIsAllowed($device)) {
131
- $last_ping = Rrd::lastUpdate(Rrd::name($device->hostname, 'icmp-perf'));
+ try {
132
+ $last_ping = Rrd::lastUpdate(Rrd::name($device->hostname, 'icmp-perf'));
133
+ } catch (\Exception $e) {
134
+ Log::error("Error getting last ping for device {$device->hostname}: {$e->getMessage()}");
135
+ $last_ping = null;
136
+ }
137
if ($last_ping) {
138
$obj['ping_timestamp'] = $last_ping->timestamp;
139
$obj['ping_loss'] = Number::calculatePercent($last_ping->get('xmt') - $last_ping->get('rcv'), $last_ping->get('xmt'));
0 commit comments