/******************************************************************************
* Icinga 2 *
- * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
#include "base/objectlock.hpp"
#include <boost/tuple/tuple.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <fstream>
state_hist_service_states->Add(state_hist_bag);
Log(LogDebug, "StateHistTable")
- << "statehist: Adding new object '" << checkable->GetName() << "' to services cache.";
+ << "statehist: Adding new object '" << checkable->GetName() << "' to services cache.";
} else {
state_hist_service_states = m_CheckablesCache[checkable];
state_hist_bag = state_hist_service_states->Get(state_hist_service_states->GetLength()-1); /* fetch latest state from history */
state_hist_service_states->Add(state_hist_bag_new);
Log(LogDebug, "StateHistTable")
- << "statehist: State change detected for object '" << checkable->GetName() << "' in '" << log_line << "'.";
+ << "statehist: State change detected for object '" << checkable->GetName() << "' in '" << log_line << "'.";
}
break;
case LogEntryTypeHostFlapping:
}
void StateHistTable::AddColumns(Table *table, const String& prefix,
- const Column::ObjectAccessor& objectAccessor)
+ const Column::ObjectAccessor& objectAccessor)
{
table->AddColumn(prefix + "time", Column(&StateHistTable::TimeAccessor, objectAccessor));
table->AddColumn(prefix + "lineno", Column(&StateHistTable::LinenoAccessor, objectAccessor));
ServicesTable::AddColumns(table, "current_service_", std::bind(&StateHistTable::ServiceAccessor, _1, objectAccessor));
}
-String StateHistTable::GetName(void) const
+String StateHistTable::GetName() const
{
return "log";
}
-String StateHistTable::GetPrefix(void) const
+String StateHistTable::GetPrefix() const
{
return "log";
}
void StateHistTable::FetchRows(const AddRowFunction& addRowFn)
{
Log(LogDebug, "StateHistTable")
- << "Pre-selecting log file from " << m_TimeFrom << " until " << m_TimeUntil;
+ << "Pre-selecting log file from " << m_TimeFrom << " until " << m_TimeUntil;
/* create log file index */
LivestatusLogUtility::CreateLogIndex(m_CompatLogPath, m_LogFileIndex);
String host_name = static_cast<Dictionary::Ptr>(row)->Get("host_name");
if (host_name.IsEmpty())
- return Object::Ptr();
+ return nullptr;
return Host::GetByName(host_name);
}
String service_description = static_cast<Dictionary::Ptr>(row)->Get("service_description");
if (service_description.IsEmpty() || host_name.IsEmpty())
- return Object::Ptr();
+ return nullptr;
return Service::GetByNamePair(host_name, service_description);
}