mirror of https://github.com/Icinga/icinga2.git
Add macro "check_source" for hosts and services to use them in notification mails
fixes #8277 Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
This commit is contained in:
parent
a4bfa99552
commit
2d393eab28
|
@ -2045,6 +2045,7 @@ hosts or services:
|
||||||
host.output | The last check's output.
|
host.output | The last check's output.
|
||||||
host.perfdata | The last check's performance data.
|
host.perfdata | The last check's performance data.
|
||||||
host.last_check | The timestamp when the last check was executed.
|
host.last_check | The timestamp when the last check was executed.
|
||||||
|
host.check_source | The monitoring instance that performed the last check.
|
||||||
host.num_services | Number of services associated with the host.
|
host.num_services | Number of services associated with the host.
|
||||||
host.num_services_ok | Number of services associated with the host which are in an `OK` state.
|
host.num_services_ok | Number of services associated with the host which are in an `OK` state.
|
||||||
host.num_services_warning | Number of services associated with the host which are in a `WARNING` state.
|
host.num_services_warning | Number of services associated with the host which are in a `WARNING` state.
|
||||||
|
@ -2076,6 +2077,7 @@ services:
|
||||||
service.output | The last check's output.
|
service.output | The last check's output.
|
||||||
service.perfdata | The last check's performance data.
|
service.perfdata | The last check's performance data.
|
||||||
service.last_check | The timestamp when the last check was executed.
|
service.last_check | The timestamp when the last check was executed.
|
||||||
|
service.check_source | The monitoring instance that performed the last check.
|
||||||
|
|
||||||
### <a id="command-runtime-macros"></a> Command Runtime Macros
|
### <a id="command-runtime-macros"></a> Command Runtime Macros
|
||||||
|
|
||||||
|
|
|
@ -280,6 +280,9 @@ bool Host::ResolveMacro(const String& macro, const CheckResult::Ptr&, Value *res
|
||||||
} else if (macro == "last_check") {
|
} else if (macro == "last_check") {
|
||||||
*result = Convert::ToString((long)cr->GetScheduleStart());
|
*result = Convert::ToString((long)cr->GetScheduleStart());
|
||||||
return true;
|
return true;
|
||||||
|
} else if (macro == "check_source") {
|
||||||
|
*result = cr->GetCheckSource();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,9 @@ bool Service::ResolveMacro(const String& macro, const CheckResult::Ptr& cr, Valu
|
||||||
} else if (macro == "last_check") {
|
} else if (macro == "last_check") {
|
||||||
*result = Convert::ToString((long)cr->GetExecutionEnd());
|
*result = Convert::ToString((long)cr->GetExecutionEnd());
|
||||||
return true;
|
return true;
|
||||||
|
} else if (macro == "check_source") {
|
||||||
|
*result = cr->GetCheckSource();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue