diff --git a/library/Icingadb/Common/Macros.php b/library/Icingadb/Common/Macros.php index c7f0e1549..0ace2a9e1 100644 --- a/library/Icingadb/Common/Macros.php +++ b/library/Icingadb/Common/Macros.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Icingadb\Common; +use DateTime; use Icinga\Application\Logger; use Icinga\Module\Icingadb\Compat\CompatHost; use Icinga\Module\Icingadb\Compat\CompatService; @@ -120,6 +121,10 @@ public function resolveMacro(string $macro, $object): string $value = null; } - return $value !== null ? $value : $macro; + if ($value instanceof DateTime) { + $value = $value->getTimestamp(); + } + + return $value ?? $macro; } }