REGISTER_STATSFUNCTION(FileLoggerStats, &FileLogger::StatsFunc);
-Value FileLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
+void FileLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("filelogger", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(FileLogger);
DECLARE_OBJECTNAME(FileLogger);
- static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
+ static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
virtual void Start(void);
: m_Callback(function)
{ }
-Value StatsFunction::Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata)
+void StatsFunction::Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata)
{
- return m_Callback(status, perfdata);
+ m_Callback(status, perfdata);
}
StatsFunctionRegistry *StatsFunctionRegistry::GetInstance(void)
public:
DECLARE_PTR_TYPEDEFS(StatsFunction);
- typedef boost::function<Value (Dictionary::Ptr& status, Array::Ptr& perfdata)> Callback;
+ typedef boost::function<void (Dictionary::Ptr& status, Array::Ptr& perfdata)> Callback;
StatsFunction(const Callback& function);
- Value Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata);
+ void Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata);
private:
Callback m_Callback;
REGISTER_STATSFUNCTION(SyslogLoggerStats, &SyslogLogger::StatsFunc);
-Value SyslogLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
+void SyslogLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("sysloglogger", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(SyslogLogger);
DECLARE_OBJECTNAME(SyslogLogger);
- static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
+ static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
protected:
virtual void ProcessLogEntry(const LogEntry& entry);
REGISTER_STATSFUNCTION(CheckerComponentStats, &CheckerComponent::StatsFunc);
-Value CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
+void CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("checkercomponent", nodes);
-
- return 0;
}
void CheckerComponent::OnConfigLoaded(void)
virtual void Start(void);
virtual void Stop(void);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
unsigned long GetIdleCheckables(void);
unsigned long GetPendingCheckables(void);
REGISTER_STATSFUNCTION(CheckResultReaderStats, &CheckResultReader::StatsFunc);
-Value CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("checkresultreader", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(CheckResultReader);
DECLARE_OBJECTNAME(CheckResultReader);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Start(void);
REGISTER_STATSFUNCTION(CompatLoggerStats, &CompatLogger::StatsFunc);
-Value CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("compatlogger", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(CompatLogger);
DECLARE_OBJECTNAME(CompatLogger);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
static void ValidateRotationMethod(const String& location, const CompatLogger::Ptr& object);
REGISTER_STATSFUNCTION(ExternalCommandListenerStats, &ExternalCommandListener::StatsFunc);
-Value ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("externalcommandlistener", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(ExternalCommandListener);
DECLARE_OBJECTNAME(ExternalCommandListener);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Start(void);
REGISTER_STATSFUNCTION(StatusDataWriterStats, &StatusDataWriter::StatsFunc);
-Value StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("statusdatawriter", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(StatusDataWriter);
DECLARE_OBJECTNAME(StatusDataWriter);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Start(void);
: m_QueryQueue(500000), m_Connected(false)
{ }
-Value IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
+void IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("idomysqlconnection", nodes);
-
- return 0;
}
void IdoMysqlConnection::Resume(void)
IdoMysqlConnection(void);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Resume(void);
: m_QueryQueue(500000), m_Connection(NULL)
{ }
-Value IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
+void IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("idopgsqlconnection", nodes);
-
- return 0;
}
void IdoPgsqlConnection::Resume(void)
DECLARE_OBJECTNAME(IdoPgsqlConnection);
IdoPgsqlConnection(void);
-
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Resume(void);
Array::Ptr perfdata = new Array();
String name;
- Value ret;
BOOST_FOREACH(tie(name, boost::tuples::ignore), StatsFunctionRegistry::GetInstance()->GetItems()) {
StatsFunction::Ptr func = StatsFunctionRegistry::GetInstance()->GetItem(name);
if (!func)
BOOST_THROW_EXCEPTION(std::invalid_argument("Function '" + name + "' does not exist."));
- ret = func->Invoke(status, perfdata);
+ func->Invoke(status, perfdata);
}
return std::make_pair(status, perfdata);
REGISTER_STATSFUNCTION(IcingaApplicationStats, &IcingaApplication::StatsFunc);
-Value IcingaApplication::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
+void IcingaApplication::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("icingaapplication", nodes);
-
- return 0;
}
/**
int Main(void);
- static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
+ static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
static IcingaApplication::Ptr GetInstance(void);
REGISTER_STATSFUNCTION(IcingaStatusWriterStats, &IcingaStatusWriter::StatsFunc);
-Value IcingaStatusWriter::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
+void IcingaStatusWriter::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("icingastatuswriter", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(IcingaStatusWriter);
DECLARE_OBJECTNAME(IcingaStatusWriter);
- static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
+ static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
static Dictionary::Ptr GetStatusData(void);
protected:
REGISTER_STATSFUNCTION(LivestatusListenerStats, &LivestatusListener::StatsFunc);
-Value LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
+void LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("livestatuslistener", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(LivestatusListener);
DECLARE_OBJECTNAME(LivestatusListener);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
static int GetClientsConnected(void);
static int GetConnections(void);
REGISTER_STATSFUNCTION(NotificationComponentStats, &NotificationComponent::StatsFunc);
-Value NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("notificationcomponent", nodes);
-
- return 0;
}
/**
DECLARE_OBJECT(NotificationComponent);
DECLARE_OBJECTNAME(NotificationComponent);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
virtual void Start(void);
private:
Stream::Ptr m_Stream;
-
+
Timer::Ptr m_ReconnectTimer;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
- void NotificationToUserHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
- const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr,
- const String& author, const String& comment_text, const String& command_name);
- String ComposeGelfMessage(const Dictionary::Ptr& fields, const String& source);
- void StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type);
- void SendLogMessage(const String& gelf);
+ void NotificationToUserHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
+ const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr,
+ const String& author, const String& comment_text, const String& command_name);
+ String ComposeGelfMessage(const Dictionary::Ptr& fields, const String& source);
+ void StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type);
+ void SendLogMessage(const String& gelf);
void ReconnectTimerHandler(void);
};
REGISTER_STATSFUNCTION(GraphiteWriterStats, &GraphiteWriter::StatsFunc);
-Value GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("graphitewriter", nodes);
-
- return 0;
}
void GraphiteWriter::Start(void)
DECLARE_OBJECT(GraphiteWriter);
DECLARE_OBJECTNAME(GraphiteWriter);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Start(void);
private:
Stream::Ptr m_Stream;
-
+
Timer::Ptr m_ReconnectTimer;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
REGISTER_STATSFUNCTION(OpenTsdbWriterStats, &OpenTsdbWriter::StatsFunc);
-Value OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("opentsdbwriter", nodes);
-
- return 0;
}
void OpenTsdbWriter::Start(void)
DECLARE_OBJECT(OpenTsdbWriter);
DECLARE_OBJECTNAME(OpenTsdbWriter);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Start(void);
private:
Stream::Ptr m_Stream;
-
+
Timer::Ptr m_ReconnectTimer;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
REGISTER_STATSFUNCTION(PerfdataWriterStats, &PerfdataWriter::StatsFunc);
-Value PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
+void PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{
Dictionary::Ptr nodes = new Dictionary();
}
status->Set("perfdatawriter", nodes);
-
- return 0;
}
void PerfdataWriter::Start(void)
DECLARE_OBJECT(PerfdataWriter);
DECLARE_OBJECTNAME(PerfdataWriter);
- static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
+ static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected:
virtual void Start(void);
}
}
-Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
+void ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
{
Dictionary::Ptr nodes = new Dictionary();
std::pair<Dictionary::Ptr, Dictionary::Ptr> stats;
ApiListener::Ptr listener = ApiListener::GetInstance();
if (!listener)
- return 0;
+ return;
stats = listener->GetStatus();
perfdata->Add("'api_" + kv.first + "'=" + Convert::ToString(kv.second));
status->Set("api", stats.first);
-
- return 0;
}
std::pair<Dictionary::Ptr, Dictionary::Ptr> ApiListener::GetStatus(void)
void SyncSendMessage(const Endpoint::Ptr& endpoint, const Dictionary::Ptr& message);
void RelayMessage(const MessageOrigin& origin, const DynamicObject::Ptr& secobj, const Dictionary::Ptr& message, bool log);
- static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
+ static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
std::pair<Dictionary::Ptr, Dictionary::Ptr> GetStatus(void);
void AddAnonymousClient(const ApiClient::Ptr& aclient);