mirror of https://github.com/Icinga/icinga2.git
parent
721483e0b2
commit
3211756656
|
@ -40,7 +40,7 @@ void GelfWriter::Start(void)
|
|||
{
|
||||
DynamicObject::Start();
|
||||
|
||||
m_ReconnectTimer = make_shared<Timer>();
|
||||
m_ReconnectTimer = new Timer();
|
||||
m_ReconnectTimer->SetInterval(10);
|
||||
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&GelfWriter::ReconnectTimerHandler, this));
|
||||
m_ReconnectTimer->Start();
|
||||
|
@ -59,7 +59,7 @@ void GelfWriter::ReconnectTimerHandler(void)
|
|||
if (m_Stream)
|
||||
return;
|
||||
|
||||
TcpSocket::Ptr socket = make_shared<TcpSocket>();
|
||||
TcpSocket::Ptr socket = new TcpSocket();
|
||||
|
||||
Log(LogNotice, "GelfWriter")
|
||||
<< "Reconnecting to GELF endpoint '" << GetHost() << "' port '" << GetPort() << "'.";
|
||||
|
@ -72,14 +72,14 @@ void GelfWriter::ReconnectTimerHandler(void)
|
|||
return;
|
||||
}
|
||||
|
||||
m_Stream = make_shared<NetworkStream>(socket);
|
||||
m_Stream = new NetworkStream(socket);
|
||||
}
|
||||
|
||||
void GelfWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
||||
{
|
||||
CONTEXT("GELF Processing check result for '" + checkable->GetName() + "'");
|
||||
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = new Dictionary();
|
||||
Service::Ptr service = dynamic_pointer_cast<Service>(checkable);
|
||||
Host::Ptr host;
|
||||
|
||||
|
@ -118,7 +118,7 @@ void GelfWriter::NotificationToUserHandler(const Notification::Ptr& notification
|
|||
if (cr)
|
||||
output = CompatUtility::GetCheckResultOutput(cr);
|
||||
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = new Dictionary();
|
||||
if (service) {
|
||||
host = service->GetHost();
|
||||
fields->Set("_type", "SERVICE NOTIFICATION");
|
||||
|
@ -145,7 +145,7 @@ void GelfWriter::StateChangeHandler(const Checkable::Ptr& checkable, const Check
|
|||
Service::Ptr service;
|
||||
tie(host, service) = GetHostService(checkable);
|
||||
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = new Dictionary();
|
||||
fields->Set("_state", service ? static_cast<int>(service->GetState()) : static_cast<int>(host->GetState()));
|
||||
fields->Set("_type", "STATE CHANGE");
|
||||
fields->Set("_current_check_attempt", checkable->GetCheckAttempt());
|
||||
|
|
Loading…
Reference in New Issue