mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
parent
e5cb093d12
commit
6eae4508aa
@ -46,7 +46,7 @@ Dictionary::Ptr PluginCheckTask::ScriptFunc(const Service::Ptr& service)
|
|||||||
resolvers.push_back(commandObj);
|
resolvers.push_back(commandObj);
|
||||||
resolvers.push_back(IcingaApplication::GetInstance());
|
resolvers.push_back(IcingaApplication::GetInstance());
|
||||||
|
|
||||||
Value command = MacroProcessor::ResolveMacros(raw_command, resolvers, Dictionary::Ptr(), Utility::EscapeShellCmd, commandObj->GetEscapeMacros());
|
Value command = MacroProcessor::ResolveMacros(raw_command, resolvers, service->GetLastCheckResult(), Utility::EscapeShellCmd, commandObj->GetEscapeMacros());
|
||||||
|
|
||||||
Dictionary::Ptr envMacros = boost::make_shared<Dictionary>();
|
Dictionary::Ptr envMacros = boost::make_shared<Dictionary>();
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ Dictionary::Ptr PluginCheckTask::ScriptFunc(const Service::Ptr& service)
|
|||||||
BOOST_FOREACH(const String& macro, export_macros) {
|
BOOST_FOREACH(const String& macro, export_macros) {
|
||||||
String value;
|
String value;
|
||||||
|
|
||||||
if (!MacroProcessor::ResolveMacro(macro, resolvers, Dictionary::Ptr(), &value)) {
|
if (!MacroProcessor::ResolveMacro(macro, resolvers, service->GetLastCheckResult(), &value)) {
|
||||||
Log(LogWarning, "icinga", "export_macros for service '" + service->GetName() + "' refers to unknown macro '" + macro + "'");
|
Log(LogWarning, "icinga", "export_macros for service '" + service->GetName() + "' refers to unknown macro '" + macro + "'");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ void PluginEventTask::ScriptFunc(const Service::Ptr& service)
|
|||||||
resolvers.push_back(commandObj);
|
resolvers.push_back(commandObj);
|
||||||
resolvers.push_back(IcingaApplication::GetInstance());
|
resolvers.push_back(IcingaApplication::GetInstance());
|
||||||
|
|
||||||
Value command = MacroProcessor::ResolveMacros(raw_command, resolvers, Dictionary::Ptr(), Utility::EscapeShellCmd, commandObj->GetEscapeMacros());
|
Value command = MacroProcessor::ResolveMacros(raw_command, resolvers, service->GetLastCheckResult(), Utility::EscapeShellCmd, commandObj->GetEscapeMacros());
|
||||||
|
|
||||||
Dictionary::Ptr envMacros = boost::make_shared<Dictionary>();
|
Dictionary::Ptr envMacros = boost::make_shared<Dictionary>();
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ void PluginEventTask::ScriptFunc(const Service::Ptr& service)
|
|||||||
BOOST_FOREACH(const String& macro, export_macros) {
|
BOOST_FOREACH(const String& macro, export_macros) {
|
||||||
String value;
|
String value;
|
||||||
|
|
||||||
if (!MacroProcessor::ResolveMacro(macro, resolvers, Dictionary::Ptr(), &value)) {
|
if (!MacroProcessor::ResolveMacro(macro, resolvers, service->GetLastCheckResult(), &value)) {
|
||||||
Log(LogWarning, "icinga", "export_macros for command '" + commandObj->GetName() + "' refers to unknown macro '" + macro + "'");
|
Log(LogWarning, "icinga", "export_macros for command '" + commandObj->GetName() + "' refers to unknown macro '" + macro + "'");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user