mirror of https://github.com/Icinga/icinga2.git
Fix: missing check_command attribute results in sigsegv on check execution
Fixes #4331
This commit is contained in:
parent
2b1c268ecd
commit
b0ac607caf
|
@ -50,6 +50,8 @@ type Host {
|
||||||
%attribute string "*"
|
%attribute string "*"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
%attribute name(CheckCommand) "check_command",
|
||||||
|
|
||||||
%attribute name(TimePeriod) "check_period",
|
%attribute name(TimePeriod) "check_period",
|
||||||
%attribute number "check_interval",
|
%attribute number "check_interval",
|
||||||
%attribute number "retry_interval",
|
%attribute number "retry_interval",
|
||||||
|
@ -331,4 +333,4 @@ type NotificationCommand inherits Command {
|
||||||
|
|
||||||
type EventCommand inherits Command {
|
type EventCommand inherits Command {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -582,7 +582,12 @@ void Service::ExecuteCheck(void)
|
||||||
Dictionary::Ptr result;
|
Dictionary::Ptr result;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = GetCheckCommand()->Execute(GetSelf());
|
CheckCommand::Ptr command = GetCheckCommand();
|
||||||
|
|
||||||
|
if (!command)
|
||||||
|
return;
|
||||||
|
|
||||||
|
result = command->Execute(GetSelf());
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
std::ostringstream msgbuf;
|
std::ostringstream msgbuf;
|
||||||
msgbuf << "Exception occured during check for service '"
|
msgbuf << "Exception occured during check for service '"
|
||||||
|
|
Loading…
Reference in New Issue