mirror of https://github.com/Icinga/icinga2.git
cluster: Log ignored messages.
This commit is contained in:
parent
74579fba59
commit
48ec2dfd08
|
@ -1022,9 +1022,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Dictionary::Ptr cr = params->Get("check_result");
|
Dictionary::Ptr cr = params->Get("check_result");
|
||||||
|
|
||||||
if (!cr)
|
if (!cr)
|
||||||
|
@ -1041,9 +1046,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double nextCheck = params->Get("next_check");
|
double nextCheck = params->Get("next_check");
|
||||||
|
|
||||||
service->SetNextCheck(nextCheck, sender->GetName());
|
service->SetNextCheck(nextCheck, sender->GetName());
|
||||||
|
@ -1057,9 +1067,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool forced = params->Get("forced");
|
bool forced = params->Get("forced");
|
||||||
|
|
||||||
service->SetForceNextCheck(forced, sender->GetName());
|
service->SetForceNextCheck(forced, sender->GetName());
|
||||||
|
@ -1073,9 +1088,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool forced = params->Get("forced");
|
bool forced = params->Get("forced");
|
||||||
|
|
||||||
service->SetForceNextNotification(forced, sender->GetName());
|
service->SetForceNextNotification(forced, sender->GetName());
|
||||||
|
@ -1089,9 +1109,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool enabled = params->Get("enabled");
|
bool enabled = params->Get("enabled");
|
||||||
|
|
||||||
service->SetEnableActiveChecks(enabled, sender->GetName());
|
service->SetEnableActiveChecks(enabled, sender->GetName());
|
||||||
|
@ -1105,9 +1130,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool enabled = params->Get("enabled");
|
bool enabled = params->Get("enabled");
|
||||||
|
|
||||||
service->SetEnablePassiveChecks(enabled, sender->GetName());
|
service->SetEnablePassiveChecks(enabled, sender->GetName());
|
||||||
|
@ -1121,9 +1151,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool enabled = params->Get("enabled");
|
bool enabled = params->Get("enabled");
|
||||||
|
|
||||||
service->SetEnableNotifications(enabled, sender->GetName());
|
service->SetEnableNotifications(enabled, sender->GetName());
|
||||||
|
@ -1137,9 +1172,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool enabled = params->Get("enabled");
|
bool enabled = params->Get("enabled");
|
||||||
|
|
||||||
service->SetEnableFlapping(enabled, sender->GetName());
|
service->SetEnableFlapping(enabled, sender->GetName());
|
||||||
|
@ -1153,9 +1193,16 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Notification::Ptr notification = Notification::GetByName(nfc);
|
Notification::Ptr notification = Notification::GetByName(nfc);
|
||||||
|
|
||||||
if (!notification || !notification->GetService()->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!notification)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Service::Ptr service = notification->GetService();
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool nextNotification = params->Get("next_notification");
|
bool nextNotification = params->Get("next_notification");
|
||||||
|
|
||||||
notification->SetNextNotification(nextNotification, sender->GetName());
|
notification->SetNextNotification(nextNotification, sender->GetName());
|
||||||
|
@ -1169,9 +1216,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Dictionary::Ptr comment = params->Get("comment");
|
Dictionary::Ptr comment = params->Get("comment");
|
||||||
|
|
||||||
long type = static_cast<long>(comment->Get("entry_type"));
|
long type = static_cast<long>(comment->Get("entry_type"));
|
||||||
|
@ -1187,9 +1239,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String id = params->Get("id");
|
String id = params->Get("id");
|
||||||
|
|
||||||
service->RemoveComment(id, sender->GetName());
|
service->RemoveComment(id, sender->GetName());
|
||||||
|
@ -1203,9 +1260,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Dictionary::Ptr downtime = params->Get("downtime");
|
Dictionary::Ptr downtime = params->Get("downtime");
|
||||||
|
|
||||||
service->AddDowntime(downtime->Get("comment_id"),
|
service->AddDowntime(downtime->Get("comment_id"),
|
||||||
|
@ -1222,9 +1284,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String id = params->Get("id");
|
String id = params->Get("id");
|
||||||
|
|
||||||
service->RemoveDowntime(id, sender->GetName());
|
service->RemoveDowntime(id, sender->GetName());
|
||||||
|
@ -1238,9 +1305,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String author = params->Get("author");
|
String author = params->Get("author");
|
||||||
String comment = params->Get("comment");
|
String comment = params->Get("comment");
|
||||||
int type = params->Get("type");
|
int type = params->Get("type");
|
||||||
|
@ -1257,9 +1329,14 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||||
|
|
||||||
Service::Ptr service = Service::GetByName(svc);
|
Service::Ptr service = Service::GetByName(svc);
|
||||||
|
|
||||||
if (!service || !service->HasPrivileges(sender->GetName(), DomainPrivCommand))
|
if (!service)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!service->HasPrivileges(sender->GetName(), DomainPrivCommand)) {
|
||||||
|
Log(LogDebug, "cluster", "Not accepting message from endpoint '" + sender->GetName() + "' for service '" + service->GetName() + "': Insufficient privileges.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(service);
|
ObjectLock olock(service);
|
||||||
service->ClearAcknowledgement(sender->GetName());
|
service->ClearAcknowledgement(sender->GetName());
|
||||||
|
|
Loading…
Reference in New Issue