Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot process passive host check result for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot process passive host check result for host '" + arguments[0] + "' which has no check service."));
if (!hc->GetEnablePassiveChecks())
BOOST_THROW_EXCEPTION(std::invalid_argument("Got passive check result for host '" + arguments[0] + "' which has passive checks disabled."));
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot reschedule host check for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot reschedule host check for host '" + arguments[0] + "' which has no check service."));
double planned_check = Convert::ToDouble(arguments[1]);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot reschedule forced host check for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot reschedule forced host check for host '" + arguments[0] + "' which has no check service."));
Log(LogInformation, "icinga", "Rescheduling next check for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host checks for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host checks for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Enabling active checks for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Enabling active checks for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable host checks for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable host checks for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Disabling active checks for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Disabling active checks for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable passive host checks for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable passive host checks for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Enabling passive checks for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Enabling passive checks for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable passive host checks for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable passive host checks for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Disabling passive checks for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Disabling passive checks for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot delay host notification for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot delay host notification for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Delaying notifications for host '" + host->GetName() + "'");
+ Log(LogInformation, "icinga", "Delaying notifications for host '" + host->GetName() + "'");
BOOST_FOREACH(const Notification::Ptr& notification, hc->GetNotifications()) {
ObjectLock olock(notification);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host notifications for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host notifications for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Enabling notifications for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Enabling notifications for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable host notifications for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable host notifications for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Disabling notifications for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Disabling notifications for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
Service::Ptr hc = host->GetCheckService();
- if (!hc) {
- Log(LogInformation, "icinga", "Cannot disable active checks for host '" + host->GetName() + "' which has no check service.");
- } else {
- Log(LogInformation, "icinga", "Disabling active checks for host '" + host->GetName() + "'");
+ if (!hc) {
+ Log(LogInformation, "icinga", "Cannot disable active checks for host '" + host->GetName() + "' which has no check service.");
+ } else {
+ Log(LogInformation, "icinga", "Disabling active checks for host '" + host->GetName() + "'");
- {
- ObjectLock olock(hc);
+ {
+ ObjectLock olock(hc);
- hc->SetEnableActiveChecks(false);
- }
- }
+ hc->SetEnableActiveChecks(false);
+ }
+ }
}
}
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
Service::Ptr hc = host->GetCheckService();
- if (!hc) {
- Log(LogInformation, "icinga", "Cannot disable passive checks for host '" + host->GetName() + "' which has no check service.");
- } else {
- Log(LogInformation, "icinga", "Disabling passive checks for host '" + host->GetName() + "'");
+ if (!hc) {
+ Log(LogInformation, "icinga", "Cannot disable passive checks for host '" + host->GetName() + "' which has no check service.");
+ } else {
+ Log(LogInformation, "icinga", "Disabling passive checks for host '" + host->GetName() + "'");
- {
- ObjectLock olock(hc);
+ {
+ ObjectLock olock(hc);
- hc->SetEnablePassiveChecks(false);
- }
- }
+ hc->SetEnablePassiveChecks(false);
+ }
+ }
}
}
Service::Ptr hc = host->GetCheckService();
- if (!hc) {
- Log(LogInformation, "icinga", "Cannot disable active checks for host '" + host->GetName() + "' which has no check service.");
- } else {
- Log(LogInformation, "icinga", "Disabling active checks for host '" + host->GetName() + "'");
+ if (!hc) {
+ Log(LogInformation, "icinga", "Cannot disable active checks for host '" + host->GetName() + "' which has no check service.");
+ } else {
+ Log(LogInformation, "icinga", "Disabling active checks for host '" + host->GetName() + "'");
- {
- ObjectLock olock(hc);
+ {
+ ObjectLock olock(hc);
- hc->SetEnableActiveChecks(false);
- }
- }
+ hc->SetEnableActiveChecks(false);
+ }
+ }
}
}
Service::Ptr hc = host->GetCheckService();
- if (!hc) {
- Log(LogInformation, "icinga", "Cannot disable passive checks for host '" + host->GetName() + "' which has no check service.");
- } else {
- Log(LogInformation, "icinga", "Disabling passive checks for host '" + host->GetName() + "'");
+ if (!hc) {
+ Log(LogInformation, "icinga", "Cannot disable passive checks for host '" + host->GetName() + "' which has no check service.");
+ } else {
+ Log(LogInformation, "icinga", "Disabling passive checks for host '" + host->GetName() + "'");
- {
- ObjectLock olock(hc);
+ {
+ ObjectLock olock(hc);
- hc->SetEnablePassiveChecks(false);
- }
- }
+ hc->SetEnablePassiveChecks(false);
+ }
+ }
}
}
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
Service::Ptr hc = host->GetCheckService();
- if (!hc) {
- Log(LogInformation, "icinga", "Cannot enable active checks for host '" + host->GetName() + "' which has no check service.");
- } else {
- Log(LogInformation, "icinga", "Enabling active checks for host '" + host->GetName() + "'");
+ if (!hc) {
+ Log(LogInformation, "icinga", "Cannot enable active checks for host '" + host->GetName() + "' which has no check service.");
+ } else {
+ Log(LogInformation, "icinga", "Enabling active checks for host '" + host->GetName() + "'");
- {
- ObjectLock olock(hc);
+ {
+ ObjectLock olock(hc);
- hc->SetEnableActiveChecks(true);
- }
- }
+ hc->SetEnableActiveChecks(true);
+ }
+ }
}
}
Service::Ptr hc = host->GetCheckService();
- if (!hc) {
- Log(LogInformation, "icinga", "Cannot enable active checks for host '" + host->GetName() + "' which has no check service.");
- } else {
- Log(LogInformation, "icinga", "Enabling active checks for host '" + host->GetName() + "'");
+ if (!hc) {
+ Log(LogInformation, "icinga", "Cannot enable active checks for host '" + host->GetName() + "' which has no check service.");
+ } else {
+ Log(LogInformation, "icinga", "Enabling active checks for host '" + host->GetName() + "'");
- {
- ObjectLock olock(hc);
+ {
+ ObjectLock olock(hc);
- hc->SetEnableActiveChecks(true);
- }
- }
+ hc->SetEnableActiveChecks(true);
+ }
+ }
}
}
Service::Ptr hc = host->GetCheckService();
- if (!hc) {
- Log(LogInformation, "icinga", "Cannot enable passive host checks for host '" + host->GetName() + "' which has no check service.");
- } else {
- Log(LogInformation, "icinga", "Enabling passive checks for host '" + host->GetName() + "'");
+ if (!hc) {
+ Log(LogInformation, "icinga", "Cannot enable passive host checks for host '" + host->GetName() + "' which has no check service.");
+ } else {
+ Log(LogInformation, "icinga", "Enabling passive checks for host '" + host->GetName() + "'");
- {
- ObjectLock olock(hc);
+ {
+ ObjectLock olock(hc);
- hc->SetEnablePassiveChecks(false);
- }
- }
+ hc->SetEnablePassiveChecks(false);
+ }
+ }
}
}
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host flapping for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host flapping for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Enabling flapping detection for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Enabling flapping detection for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable host flapping for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable host flapping for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Disabling flapping detection for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Disabling flapping detection for host '" + arguments[0] + "'");
{
ObjectLock olock(hc);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot update modified attributes for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot update modified attributes for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Updating modified attributes for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Updating modified attributes for host '" + arguments[0] + "'");
int modifiedAttributes = Convert::ToLong(arguments[1]);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot update check interval for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot update check interval for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Updating check interval for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Updating check interval for host '" + arguments[0] + "'");
double interval = Convert::ToDouble(arguments[1]);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot update retry interval for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot update retry interval for host '" + arguments[0] + "' which has no check service."));
- Log(LogInformation, "icinga", "Updating retry interval for host '" + arguments[0] + "'");
+ Log(LogInformation, "icinga", "Updating retry interval for host '" + arguments[0] + "'");
double interval = Convert::ToDouble(arguments[1]);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable event handler for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable event handler for host '" + arguments[0] + "' which has no check service."));
Log(LogInformation, "icinga", "Enabling event handler for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable event handler for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable event handler for host '" + arguments[0] + "' which has no check service."));
Log(LogInformation, "icinga", "Disabling event handler for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change event handler for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change event handler for host '" + arguments[0] + "' which has no check service."));
EventCommand::Ptr command = EventCommand::GetByName(arguments[2]);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check command for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check command for host '" + arguments[0] + "' which has no check service."));
CheckCommand::Ptr command = CheckCommand::GetByName(arguments[2]);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change max check attempts for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change max check attempts for host '" + arguments[0] + "' which has no check service."));
int attempts = Convert::ToLong(arguments[2]);
Service::Ptr hc = host->GetCheckService();
- if (!hc)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check period for host '" + arguments[0] + "' which has no check service."));
+ if (!hc)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check period for host '" + arguments[0] + "' which has no check service."));
TimePeriod::Ptr tp = TimePeriod::GetByName(arguments[2]);