diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index cd967f69..37ed681b 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -718,11 +718,15 @@ return ''; protected static function classByType($type) { + // allow for icinga_host and host + $type = preg_replace('/^icinga_/', '', $type); + if (strpos($type, 'data') === false) { $prefix = 'Icinga'; } else { $prefix = 'Director'; } + return 'Icinga\\Module\\Director\\Objects\\' . $prefix . ucfirst($type); }