How to configure fallback string/state for passive check

Mh I don’t know exactly where the recursion comes from, but I’d guess this line:

var service = get_service(macro("$host.name$"), macro("$service.name$"))

creates a reference to itself. So var service points to the object, but is declared inside the object. So called “DSL inception”.

I actually don’t know whether we may self-reference ourselves here. Since anonymous lambdas don’t allow to pass the locals or this context, one would likely need to use closures with 2 function objects. But I am not sure if you can follow up to this point, so I’ll wait.

Cheers,
Michael