diff --git a/includes/html/print-alert-rules.php b/includes/html/print-alert-rules.php
index 5df4478f7c..47597035cf 100644
--- a/includes/html/print-alert-rules.php
+++ b/includes/html/print-alert-rules.php
@@ -27,6 +27,7 @@ if (! Auth::user()->hasGlobalAdmin()) {
exit('ERROR: You need to be admin');
}
+use App\Facades\DeviceCache;
use LibreNMS\Alerting\QueryBuilderParser;
use LibreNMS\Enum\AlertState;
@@ -301,7 +302,7 @@ foreach ($rule_list as $rule) {
$device_query = 'SELECT devices.device_id,devices.hostname FROM alert_device_map, devices WHERE alert_device_map.rule_id=? and alert_device_map.device_id = devices.device_id ORDER BY hostname';
$device_maps = dbFetchRows($device_query, [$rule['id']]);
foreach ($device_maps as $device_map) {
- $devices .= $except_device_or_group . '' . htmlentities($device_map['hostname']) . '
';
+ $devices .= $except_device_or_group . '' . htmlentities(DeviceCache::get($device_map['device_id'])->displayName()) . '
';
}
}