mirror of https://github.com/Icinga/icinga2.git
parent
ff24863a72
commit
a6e70a155d
|
@ -144,7 +144,7 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
|
||||||
ExternalCommandProcessor::Execute(command);
|
ExternalCommandProcessor::Execute(command);
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Log(LogWarning, "ExternalCommandListener")
|
Log(LogWarning, "ExternalCommandListener")
|
||||||
<< "External command failed." << DiagnosticInformation(ex);
|
<< "External command failed: " << DiagnosticInformation(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,6 +195,9 @@ String Comment::AddComment(const Checkable::Ptr& checkable, CommentType entryTyp
|
||||||
|
|
||||||
Comment::Ptr comment = Comment::GetByName(fullName);
|
Comment::Ptr comment = Comment::GetByName(fullName);
|
||||||
|
|
||||||
|
if (!comment)
|
||||||
|
BOOST_THROW_EXCEPTION(std::runtime_error("Could not create comment."));
|
||||||
|
|
||||||
Log(LogNotice, "Comment")
|
Log(LogNotice, "Comment")
|
||||||
<< "Added comment '" << comment->GetName() << "'.";
|
<< "Added comment '" << comment->GetName() << "'.";
|
||||||
|
|
||||||
|
|
|
@ -251,12 +251,14 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth
|
||||||
|
|
||||||
Downtime::Ptr downtime = Downtime::GetByName(fullName);
|
Downtime::Ptr downtime = Downtime::GetByName(fullName);
|
||||||
|
|
||||||
|
if (!downtime)
|
||||||
|
BOOST_THROW_EXCEPTION(std::runtime_error("Could not create downtime."));
|
||||||
|
|
||||||
Log(LogNotice, "Downtime")
|
Log(LogNotice, "Downtime")
|
||||||
<< "Added downtime '" << downtime->GetName()
|
<< "Added downtime '" << downtime->GetName()
|
||||||
<< "' between '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", startTime)
|
<< "' between '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", startTime)
|
||||||
<< "' and '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", endTime) << "'.";
|
<< "' and '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", endTime) << "'.";
|
||||||
|
|
||||||
|
|
||||||
return fullName;
|
return fullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1210,7 +1210,7 @@ void ExternalCommandProcessor::AddHostComment(double, const std::vector<String>&
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add host comment for non-existent host '" + arguments[0] + "'"));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add host comment for non-existent host '" + arguments[0] + "'"));
|
||||||
|
|
||||||
if (arguments[2].IsEmpty() || arguments[3].IsEmpty())
|
if (arguments[2].IsEmpty() || arguments[3].IsEmpty())
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment may not be empty"));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment must not be empty"));
|
||||||
|
|
||||||
Log(LogNotice, "ExternalCommandProcessor")
|
Log(LogNotice, "ExternalCommandProcessor")
|
||||||
<< "Creating comment for host " << host->GetName();
|
<< "Creating comment for host " << host->GetName();
|
||||||
|
@ -1234,7 +1234,7 @@ void ExternalCommandProcessor::AddSvcComment(double, const std::vector<String>&
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add service comment for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'"));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add service comment for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'"));
|
||||||
|
|
||||||
if (arguments[3].IsEmpty() || arguments[4].IsEmpty())
|
if (arguments[3].IsEmpty() || arguments[4].IsEmpty())
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment may not be empty"));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment must not be empty"));
|
||||||
|
|
||||||
Log(LogNotice, "ExternalCommandProcessor")
|
Log(LogNotice, "ExternalCommandProcessor")
|
||||||
<< "Creating comment for service " << service->GetName();
|
<< "Creating comment for service " << service->GetName();
|
||||||
|
|
Loading…
Reference in New Issue