BOOST_FOREACH(const Dictionary::Pair& kv, env) {
String name = kv.second;
- Value value = MacroProcessor::ResolveMacros(name, resolvers, checkable->GetLastCheckResult());
+ Value value = MacroProcessor::ResolveMacros(name, resolvers, checkable->GetLastCheckResult(),
+ NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
envMacros->Set(kv.first, value);
}
if (it != l_Objects.end()) {
vtObject = it->second;
} else {
- String clr_assembly = MacroProcessor::ResolveMacros("$clr_assembly$", resolvers, checkable->GetLastCheckResult());
- String clr_type = MacroProcessor::ResolveMacros("$clr_type$", resolvers, checkable->GetLastCheckResult());
+ String clr_assembly = MacroProcessor::ResolveMacros("$clr_assembly$", resolvers, checkable->GetLastCheckResult(),
+ NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
+ String clr_type = MacroProcessor::ResolveMacros("$clr_type$", resolvers, checkable->GetLastCheckResult(),
+ NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
+
+ if (resolvedMacros && !useResolvedMacros)
+ return;
vtObject = CreateClrType(clr_assembly, clr_type);
l_Objects[checkable] = vtObject;
void ClusterCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ if (resolvedMacros && !useResolvedMacros)
+ return;
+
ApiListener::Ptr listener = ApiListener::GetInstance();
if (!listener) {
resolvers.push_back(std::make_pair("command", commandObj));
resolvers.push_back(std::make_pair("icinga", IcingaApplication::GetInstance()));
- String zoneName = MacroProcessor::ResolveMacros("$cluster_zone$", resolvers, checkable->GetLastCheckResult());
+ String zoneName = MacroProcessor::ResolveMacros("$cluster_zone$", resolvers, checkable->GetLastCheckResult(),
+ NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
+
+ if (resolvedMacros && !useResolvedMacros)
+ return;
if (zoneName.IsEmpty()) {
cr->SetOutput("Macro 'cluster_zone' must be set.");
void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ if (resolvedMacros && !useResolvedMacros)
+ return;
+
double interval = Utility::GetTime() - Application::GetStartTime();
if (interval > 60)
void NullCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ if (resolvedMacros && !useResolvedMacros)
+ return;
+
String output = "Hello from ";
output += Utility::GetFQDN();
void RandomCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ if (resolvedMacros && !useResolvedMacros)
+ return;
+
String output = "Hello from ";
output += Utility::GetFQDN();