Enable cluster debugging.

This commit is contained in:
Gunnar Beutner 2013-09-17 14:21:45 +02:00
parent 3ed7219fb2
commit fa52d0ab58
2 changed files with 5 additions and 6 deletions

View File

@ -249,9 +249,8 @@ void ClusterComponent::RelayMessage(const Endpoint::Ptr& source, const Dictionar
if (source) if (source)
pmessage->Set("source", source->GetName()); pmessage->Set("source", source->GetName());
pmessage->Set("security", message->Get("security"));
pmessage->Set("message", Value(message).Serialize()); pmessage->Set("message", Value(message).Serialize());
pmessage->Set("security", message->Get("security"));
ObjectLock olock(this); ObjectLock olock(this);
if (m_LogFile) { if (m_LogFile) {
@ -303,7 +302,7 @@ void ClusterComponent::RelayMessage(const Endpoint::Ptr& source, const Dictionar
continue; continue;
if (secobj && !secobj->HasPrivileges(endpoint->GetName(), privs)) { if (secobj && !secobj->HasPrivileges(endpoint->GetName(), privs)) {
Log(LogDebug, "cluster", "Not sending message to endpoint '" + endpoint->GetName() + "': Insufficient privileges."); Log(LogWarning, "cluster", "Not sending message to endpoint '" + endpoint->GetName() + "': Insufficient privileges.");
continue; continue;
} }
@ -463,7 +462,7 @@ void ClusterComponent::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Pt
} }
if (secobj && !secobj->HasPrivileges(endpoint->GetName(), privs)) { if (secobj && !secobj->HasPrivileges(endpoint->GetName(), privs)) {
Log(LogDebug, "cluster", "Not replaying message: Insufficient privileges."); Log(LogWarning, "cluster", "Not replaying message: Insufficient privileges.");
continue; continue;
} }

View File

@ -34,7 +34,7 @@ using namespace icinga;
void JsonRpc::SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message) void JsonRpc::SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message)
{ {
String json = Value(message).Serialize(); String json = Value(message).Serialize();
// std::cerr << ">> " << json << std::endl; std::cerr << ">> " << json << std::endl;
NetString::WriteStringToStream(stream, json); NetString::WriteStringToStream(stream, json);
} }
@ -44,7 +44,7 @@ Dictionary::Ptr JsonRpc::ReadMessage(const Stream::Ptr& stream)
if (!NetString::ReadStringFromStream(stream, &jsonString)) if (!NetString::ReadStringFromStream(stream, &jsonString))
BOOST_THROW_EXCEPTION(std::runtime_error("ReadStringFromStream signalled EOF.")); BOOST_THROW_EXCEPTION(std::runtime_error("ReadStringFromStream signalled EOF."));
// std::cerr << "<< " << jsonString << std::endl; std::cerr << "<< " << jsonString << std::endl;
Value value = Value::Deserialize(jsonString); Value value = Value::Deserialize(jsonString);
if (!value.IsObjectType<Dictionary>()) { if (!value.IsObjectType<Dictionary>()) {