mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
parent
24852e05c7
commit
2ae06b7a52
@ -1159,7 +1159,6 @@ The following external commands are not supported:
|
|||||||
DISABLE_FAILURE_PREDICTION
|
DISABLE_FAILURE_PREDICTION
|
||||||
DISABLE_HOST_AND_CHILD_NOTIFICATIONS
|
DISABLE_HOST_AND_CHILD_NOTIFICATIONS
|
||||||
DISABLE_HOST_FRESHNESS_CHECKS
|
DISABLE_HOST_FRESHNESS_CHECKS
|
||||||
DISABLE_HOST_SVC_NOTIFICATIONS
|
|
||||||
DISABLE_NOTIFICATIONS_EXPIRE_TIME
|
DISABLE_NOTIFICATIONS_EXPIRE_TIME
|
||||||
DISABLE_SERVICE_FRESHNESS_CHECKS
|
DISABLE_SERVICE_FRESHNESS_CHECKS
|
||||||
ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST
|
ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST
|
||||||
@ -1170,7 +1169,6 @@ The following external commands are not supported:
|
|||||||
ENABLE_FAILURE_PREDICTION
|
ENABLE_FAILURE_PREDICTION
|
||||||
ENABLE_HOST_AND_CHILD_NOTIFICATIONS
|
ENABLE_HOST_AND_CHILD_NOTIFICATIONS
|
||||||
ENABLE_HOST_FRESHNESS_CHECKS
|
ENABLE_HOST_FRESHNESS_CHECKS
|
||||||
ENABLE_HOST_SVC_NOTIFICATIONS
|
|
||||||
ENABLE_SERVICE_FRESHNESS_CHECKS
|
ENABLE_SERVICE_FRESHNESS_CHECKS
|
||||||
READ_STATE_INFORMATION
|
READ_STATE_INFORMATION
|
||||||
SAVE_STATE_INFORMATION
|
SAVE_STATE_INFORMATION
|
||||||
|
@ -68,6 +68,8 @@ Additional details can be found in the [Icinga 1.x Documentation](http://docs.ic
|
|||||||
DISABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | -
|
DISABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | -
|
||||||
ENABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
|
ENABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
|
||||||
DISABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
|
DISABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
|
||||||
|
ENABLE_HOST_SVC_NOTIFICATIONS | ;<host_name> (1) | -
|
||||||
|
DISABLE_HOST_SVC_NOTIFICATIONS | ;<host_name> (1) | -
|
||||||
DISABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
DISABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
||||||
DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
||||||
DISABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | -
|
DISABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | -
|
||||||
|
@ -233,6 +233,8 @@ void ExternalCommandProcessor::StaticInitialize(void)
|
|||||||
RegisterCommand("DISABLE_HOST_NOTIFICATIONS", &ExternalCommandProcessor::DisableHostNotifications, 1);
|
RegisterCommand("DISABLE_HOST_NOTIFICATIONS", &ExternalCommandProcessor::DisableHostNotifications, 1);
|
||||||
RegisterCommand("ENABLE_SVC_NOTIFICATIONS", &ExternalCommandProcessor::EnableSvcNotifications, 2);
|
RegisterCommand("ENABLE_SVC_NOTIFICATIONS", &ExternalCommandProcessor::EnableSvcNotifications, 2);
|
||||||
RegisterCommand("DISABLE_SVC_NOTIFICATIONS", &ExternalCommandProcessor::DisableSvcNotifications, 2);
|
RegisterCommand("DISABLE_SVC_NOTIFICATIONS", &ExternalCommandProcessor::DisableSvcNotifications, 2);
|
||||||
|
RegisterCommand("ENABLE_HOST_SVC_NOTIFICATIONS", &ExternalCommandProcessor::EnableHostSvcNotifications, 1);
|
||||||
|
RegisterCommand("DISABLE_HOST_SVC_NOTIFICATIONS", &ExternalCommandProcessor::DisableHostSvcNotifications, 1);
|
||||||
RegisterCommand("DISABLE_HOSTGROUP_HOST_CHECKS", &ExternalCommandProcessor::DisableHostgroupHostChecks, 1);
|
RegisterCommand("DISABLE_HOSTGROUP_HOST_CHECKS", &ExternalCommandProcessor::DisableHostgroupHostChecks, 1);
|
||||||
RegisterCommand("DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS", &ExternalCommandProcessor::DisableHostgroupPassiveHostChecks, 1);
|
RegisterCommand("DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS", &ExternalCommandProcessor::DisableHostgroupPassiveHostChecks, 1);
|
||||||
RegisterCommand("DISABLE_SERVICEGROUP_HOST_CHECKS", &ExternalCommandProcessor::DisableServicegroupHostChecks, 1);
|
RegisterCommand("DISABLE_SERVICEGROUP_HOST_CHECKS", &ExternalCommandProcessor::DisableServicegroupHostChecks, 1);
|
||||||
@ -1415,6 +1417,50 @@ void ExternalCommandProcessor::DisableSvcNotifications(double, const std::vector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExternalCommandProcessor::EnableHostSvcNotifications(double, const std::vector<String>& arguments)
|
||||||
|
{
|
||||||
|
Host::Ptr host = Host::GetByName(arguments[0]);
|
||||||
|
|
||||||
|
if (!host)
|
||||||
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable notifications for all services for non-existent host '" + arguments[0] + "'"));
|
||||||
|
|
||||||
|
Log(LogNotice, "ExternalCommandProcessor")
|
||||||
|
<< "Enabling notifications for all services on host '" << arguments[0] << "'";
|
||||||
|
|
||||||
|
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
|
||||||
|
Log(LogNotice, "ExternalCommandProcessor")
|
||||||
|
<< "Enabling notifications for service '" << service->GetName() << "'";
|
||||||
|
|
||||||
|
{
|
||||||
|
ObjectLock olock(service);
|
||||||
|
|
||||||
|
service->SetEnableNotifications(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExternalCommandProcessor::DisableHostSvcNotifications(double, const std::vector<String>& arguments)
|
||||||
|
{
|
||||||
|
Host::Ptr host = Host::GetByName(arguments[0]);
|
||||||
|
|
||||||
|
if (!host)
|
||||||
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable notifications for all services for non-existent host '" + arguments[0] + "'"));
|
||||||
|
|
||||||
|
Log(LogNotice, "ExternalCommandProcessor")
|
||||||
|
<< "Disabling notifications for all services on host '" << arguments[0] << "'";
|
||||||
|
|
||||||
|
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
|
||||||
|
Log(LogNotice, "ExternalCommandProcessor")
|
||||||
|
<< "Disabling notifications for service '" << service->GetName() << "'";
|
||||||
|
|
||||||
|
{
|
||||||
|
ObjectLock olock(service);
|
||||||
|
|
||||||
|
service->SetEnableNotifications(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ExternalCommandProcessor::DisableHostgroupHostChecks(double, const std::vector<String>& arguments)
|
void ExternalCommandProcessor::DisableHostgroupHostChecks(double, const std::vector<String>& arguments)
|
||||||
{
|
{
|
||||||
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
|
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
|
||||||
|
@ -100,6 +100,8 @@ private:
|
|||||||
static void DisableHostNotifications(double time, const std::vector<String>& arguments);
|
static void DisableHostNotifications(double time, const std::vector<String>& arguments);
|
||||||
static void EnableSvcNotifications(double time, const std::vector<String>& arguments);
|
static void EnableSvcNotifications(double time, const std::vector<String>& arguments);
|
||||||
static void DisableSvcNotifications(double time, const std::vector<String>& arguments);
|
static void DisableSvcNotifications(double time, const std::vector<String>& arguments);
|
||||||
|
static void EnableHostSvcNotifications(double, const std::vector<String>& arguments);
|
||||||
|
static void DisableHostSvcNotifications(double, const std::vector<String>& arguments);
|
||||||
static void DisableHostgroupHostChecks(double, const std::vector<String>& arguments);
|
static void DisableHostgroupHostChecks(double, const std::vector<String>& arguments);
|
||||||
static void DisableHostgroupPassiveHostChecks(double, const std::vector<String>& arguments);
|
static void DisableHostgroupPassiveHostChecks(double, const std::vector<String>& arguments);
|
||||||
static void DisableServicegroupHostChecks(double, const std::vector<String>& arguments);
|
static void DisableServicegroupHostChecks(double, const std::vector<String>& arguments);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user