From: Michael Friedrich Date: Sat, 7 Feb 2015 21:36:17 +0000 (+0100) Subject: Remove name and return value for stats functions X-Git-Tag: v2.3.0~275 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea2ac81003785b080db86410efab69faa2209aae;p=icinga2 Remove name and return value for stats functions fixes #6171 --- diff --git a/lib/base/filelogger.cpp b/lib/base/filelogger.cpp index 03d926354..a0e61eca5 100644 --- a/lib/base/filelogger.cpp +++ b/lib/base/filelogger.cpp @@ -29,7 +29,7 @@ REGISTER_TYPE(FileLogger); 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(); @@ -38,8 +38,6 @@ Value FileLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&) } status->Set("filelogger", nodes); - - return 0; } /** diff --git a/lib/base/filelogger.hpp b/lib/base/filelogger.hpp index 941cacb3e..7557a3e03 100644 --- a/lib/base/filelogger.hpp +++ b/lib/base/filelogger.hpp @@ -37,7 +37,7 @@ public: 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); diff --git a/lib/base/statsfunction.cpp b/lib/base/statsfunction.cpp index 2ab93cbfd..8b014e369 100644 --- a/lib/base/statsfunction.cpp +++ b/lib/base/statsfunction.cpp @@ -27,9 +27,9 @@ StatsFunction::StatsFunction(const Callback& function) : 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) diff --git a/lib/base/statsfunction.hpp b/lib/base/statsfunction.hpp index 37dbf74c2..687df0b61 100644 --- a/lib/base/statsfunction.hpp +++ b/lib/base/statsfunction.hpp @@ -40,11 +40,11 @@ class I2_BASE_API StatsFunction : public Object public: DECLARE_PTR_TYPEDEFS(StatsFunction); - typedef boost::function Callback; + typedef boost::function 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; diff --git a/lib/base/sysloglogger.cpp b/lib/base/sysloglogger.cpp index 2c9fffea4..4bafee799 100644 --- a/lib/base/sysloglogger.cpp +++ b/lib/base/sysloglogger.cpp @@ -28,7 +28,7 @@ REGISTER_TYPE(SyslogLogger); 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(); @@ -37,8 +37,6 @@ Value SyslogLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&) } status->Set("sysloglogger", nodes); - - return 0; } /** diff --git a/lib/base/sysloglogger.hpp b/lib/base/sysloglogger.hpp index d21cf27b9..c7a9d55ac 100644 --- a/lib/base/sysloglogger.hpp +++ b/lib/base/sysloglogger.hpp @@ -38,7 +38,7 @@ public: 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); diff --git a/lib/checker/checkercomponent.cpp b/lib/checker/checkercomponent.cpp index 2e50d3466..f91a5db2b 100644 --- a/lib/checker/checkercomponent.cpp +++ b/lib/checker/checkercomponent.cpp @@ -37,7 +37,7 @@ REGISTER_TYPE(CheckerComponent); 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(); @@ -57,8 +57,6 @@ Value CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Pt } status->Set("checkercomponent", nodes); - - return 0; } void CheckerComponent::OnConfigLoaded(void) diff --git a/lib/checker/checkercomponent.hpp b/lib/checker/checkercomponent.hpp index ab282aeaa..01d63b7f4 100644 --- a/lib/checker/checkercomponent.hpp +++ b/lib/checker/checkercomponent.hpp @@ -72,7 +72,7 @@ public: 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); diff --git a/lib/compat/checkresultreader.cpp b/lib/compat/checkresultreader.cpp index b2bb33b05..ac2b30c15 100644 --- a/lib/compat/checkresultreader.cpp +++ b/lib/compat/checkresultreader.cpp @@ -38,7 +38,7 @@ REGISTER_TYPE(CheckResultReader); 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(); @@ -47,8 +47,6 @@ Value CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::P } status->Set("checkresultreader", nodes); - - return 0; } /** diff --git a/lib/compat/checkresultreader.hpp b/lib/compat/checkresultreader.hpp index 9700c59ea..dd87afa9c 100644 --- a/lib/compat/checkresultreader.hpp +++ b/lib/compat/checkresultreader.hpp @@ -38,7 +38,7 @@ public: 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); diff --git a/lib/compat/compatlogger.cpp b/lib/compat/compatlogger.cpp index 2fb81a2a2..4d88edbaa 100644 --- a/lib/compat/compatlogger.cpp +++ b/lib/compat/compatlogger.cpp @@ -44,7 +44,7 @@ REGISTER_SCRIPTFUNCTION(ValidateRotationMethod, &CompatLogger::ValidateRotationM 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(); @@ -53,8 +53,6 @@ Value CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) } status->Set("compatlogger", nodes); - - return 0; } /** diff --git a/lib/compat/compatlogger.hpp b/lib/compat/compatlogger.hpp index 7bc9f6287..24ae233c2 100644 --- a/lib/compat/compatlogger.hpp +++ b/lib/compat/compatlogger.hpp @@ -39,7 +39,7 @@ public: 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); diff --git a/lib/compat/externalcommandlistener.cpp b/lib/compat/externalcommandlistener.cpp index 142384794..8522ede08 100644 --- a/lib/compat/externalcommandlistener.cpp +++ b/lib/compat/externalcommandlistener.cpp @@ -31,7 +31,7 @@ REGISTER_TYPE(ExternalCommandListener); 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(); @@ -40,8 +40,6 @@ Value ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Ar } status->Set("externalcommandlistener", nodes); - - return 0; } /** diff --git a/lib/compat/externalcommandlistener.hpp b/lib/compat/externalcommandlistener.hpp index 2448792ad..6e83eaf23 100644 --- a/lib/compat/externalcommandlistener.hpp +++ b/lib/compat/externalcommandlistener.hpp @@ -39,7 +39,7 @@ public: 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); diff --git a/lib/compat/statusdatawriter.cpp b/lib/compat/statusdatawriter.cpp index 4fd5170e5..699f0b605 100644 --- a/lib/compat/statusdatawriter.cpp +++ b/lib/compat/statusdatawriter.cpp @@ -49,7 +49,7 @@ REGISTER_TYPE(StatusDataWriter); 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(); @@ -58,8 +58,6 @@ Value StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Pt } status->Set("statusdatawriter", nodes); - - return 0; } /** diff --git a/lib/compat/statusdatawriter.hpp b/lib/compat/statusdatawriter.hpp index ac78562b4..1e6b919ee 100644 --- a/lib/compat/statusdatawriter.hpp +++ b/lib/compat/statusdatawriter.hpp @@ -44,7 +44,7 @@ public: 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); diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index f94b6b65f..3e548f3b5 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -43,7 +43,7 @@ IdoMysqlConnection::IdoMysqlConnection(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(); @@ -61,8 +61,6 @@ Value IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array:: } status->Set("idomysqlconnection", nodes); - - return 0; } void IdoMysqlConnection::Resume(void) diff --git a/lib/db_ido_mysql/idomysqlconnection.hpp b/lib/db_ido_mysql/idomysqlconnection.hpp index acbac6c51..474fbe464 100644 --- a/lib/db_ido_mysql/idomysqlconnection.hpp +++ b/lib/db_ido_mysql/idomysqlconnection.hpp @@ -44,7 +44,7 @@ public: 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); diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp index 1d74ebe32..5e9747a66 100644 --- a/lib/db_ido_pgsql/idopgsqlconnection.cpp +++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp @@ -45,7 +45,7 @@ IdoPgsqlConnection::IdoPgsqlConnection(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(); @@ -63,8 +63,6 @@ Value IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array:: } status->Set("idopgsqlconnection", nodes); - - return 0; } void IdoPgsqlConnection::Resume(void) diff --git a/lib/db_ido_pgsql/idopgsqlconnection.hpp b/lib/db_ido_pgsql/idopgsqlconnection.hpp index 3b9a79eea..4f7bf9d7d 100644 --- a/lib/db_ido_pgsql/idopgsqlconnection.hpp +++ b/lib/db_ido_pgsql/idopgsqlconnection.hpp @@ -43,8 +43,8 @@ public: 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); diff --git a/lib/icinga/cib.cpp b/lib/icinga/cib.cpp index f01b8e9b4..5b106d2bb 100644 --- a/lib/icinga/cib.cpp +++ b/lib/icinga/cib.cpp @@ -244,14 +244,13 @@ std::pair CIB::GetFeatureStats(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); diff --git a/lib/icinga/icingaapplication.cpp b/lib/icinga/icingaapplication.cpp index ed1f07503..53eddc8f1 100644 --- a/lib/icinga/icingaapplication.cpp +++ b/lib/icinga/icingaapplication.cpp @@ -63,7 +63,7 @@ void IcingaApplication::StaticInitialize(void) 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(); @@ -84,8 +84,6 @@ Value IcingaApplication::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata } status->Set("icingaapplication", nodes); - - return 0; } /** diff --git a/lib/icinga/icingaapplication.hpp b/lib/icinga/icingaapplication.hpp index 0711ecb10..2df3ecd3b 100644 --- a/lib/icinga/icingaapplication.hpp +++ b/lib/icinga/icingaapplication.hpp @@ -42,7 +42,7 @@ public: 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); diff --git a/lib/icinga/icingastatuswriter.cpp b/lib/icinga/icingastatuswriter.cpp index aad8640f3..f1df5fdd6 100644 --- a/lib/icinga/icingastatuswriter.cpp +++ b/lib/icinga/icingastatuswriter.cpp @@ -35,7 +35,7 @@ REGISTER_TYPE(IcingaStatusWriter); 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(); @@ -44,8 +44,6 @@ Value IcingaStatusWriter::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdat } status->Set("icingastatuswriter", nodes); - - return 0; } /** diff --git a/lib/icinga/icingastatuswriter.hpp b/lib/icinga/icingastatuswriter.hpp index 89ae84c66..3f2fe2d3e 100644 --- a/lib/icinga/icingastatuswriter.hpp +++ b/lib/icinga/icingastatuswriter.hpp @@ -35,7 +35,7 @@ public: 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: diff --git a/lib/livestatus/livestatuslistener.cpp b/lib/livestatus/livestatuslistener.cpp index f759bab22..41894344f 100644 --- a/lib/livestatus/livestatuslistener.cpp +++ b/lib/livestatus/livestatuslistener.cpp @@ -43,7 +43,7 @@ static boost::mutex l_ComponentMutex; 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(); @@ -57,8 +57,6 @@ Value LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array:: } status->Set("livestatuslistener", nodes); - - return 0; } /** diff --git a/lib/livestatus/livestatuslistener.hpp b/lib/livestatus/livestatuslistener.hpp index b074c6cc5..cc765a3c0 100644 --- a/lib/livestatus/livestatuslistener.hpp +++ b/lib/livestatus/livestatuslistener.hpp @@ -39,7 +39,7 @@ public: 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); diff --git a/lib/notification/notificationcomponent.cpp b/lib/notification/notificationcomponent.cpp index 588c4af8c..67357f101 100644 --- a/lib/notification/notificationcomponent.cpp +++ b/lib/notification/notificationcomponent.cpp @@ -34,7 +34,7 @@ REGISTER_TYPE(NotificationComponent); 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(); @@ -43,8 +43,6 @@ Value NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Arra } status->Set("notificationcomponent", nodes); - - return 0; } /** diff --git a/lib/notification/notificationcomponent.hpp b/lib/notification/notificationcomponent.hpp index 7955c0f58..e75f63fef 100644 --- a/lib/notification/notificationcomponent.hpp +++ b/lib/notification/notificationcomponent.hpp @@ -37,7 +37,7 @@ public: 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); diff --git a/lib/perfdata/gelfwriter.hpp b/lib/perfdata/gelfwriter.hpp index f6ae7f4d0..374010c12 100644 --- a/lib/perfdata/gelfwriter.hpp +++ b/lib/perfdata/gelfwriter.hpp @@ -46,16 +46,16 @@ protected: 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); }; diff --git a/lib/perfdata/graphitewriter.cpp b/lib/perfdata/graphitewriter.cpp index 43b6389eb..695344b12 100644 --- a/lib/perfdata/graphitewriter.cpp +++ b/lib/perfdata/graphitewriter.cpp @@ -46,7 +46,7 @@ REGISTER_TYPE(GraphiteWriter); 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(); @@ -55,8 +55,6 @@ Value GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& } status->Set("graphitewriter", nodes); - - return 0; } void GraphiteWriter::Start(void) diff --git a/lib/perfdata/graphitewriter.hpp b/lib/perfdata/graphitewriter.hpp index f2bc63482..82a136be3 100644 --- a/lib/perfdata/graphitewriter.hpp +++ b/lib/perfdata/graphitewriter.hpp @@ -41,14 +41,14 @@ public: 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); diff --git a/lib/perfdata/opentsdbwriter.cpp b/lib/perfdata/opentsdbwriter.cpp index 543116d4b..20248af95 100644 --- a/lib/perfdata/opentsdbwriter.cpp +++ b/lib/perfdata/opentsdbwriter.cpp @@ -46,7 +46,7 @@ REGISTER_TYPE(OpenTsdbWriter); 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(); @@ -55,8 +55,6 @@ Value OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& } status->Set("opentsdbwriter", nodes); - - return 0; } void OpenTsdbWriter::Start(void) diff --git a/lib/perfdata/opentsdbwriter.hpp b/lib/perfdata/opentsdbwriter.hpp index 1f6ada102..4aa3afff8 100644 --- a/lib/perfdata/opentsdbwriter.hpp +++ b/lib/perfdata/opentsdbwriter.hpp @@ -41,14 +41,14 @@ public: 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); diff --git a/lib/perfdata/perfdatawriter.cpp b/lib/perfdata/perfdatawriter.cpp index f6b276b48..5f2d625db 100644 --- a/lib/perfdata/perfdatawriter.cpp +++ b/lib/perfdata/perfdatawriter.cpp @@ -36,7 +36,7 @@ REGISTER_TYPE(PerfdataWriter); 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(); @@ -45,8 +45,6 @@ Value PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& } status->Set("perfdatawriter", nodes); - - return 0; } void PerfdataWriter::Start(void) diff --git a/lib/perfdata/perfdatawriter.hpp b/lib/perfdata/perfdatawriter.hpp index 246c6ff70..b0ced3728 100644 --- a/lib/perfdata/perfdatawriter.hpp +++ b/lib/perfdata/perfdatawriter.hpp @@ -40,7 +40,7 @@ public: 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); diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 15ef5275c..9c962dc64 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -747,7 +747,7 @@ void ApiListener::ReplayLog(const ApiClient::Ptr& client) } } -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 stats; @@ -755,7 +755,7 @@ Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata) ApiListener::Ptr listener = ApiListener::GetInstance(); if (!listener) - return 0; + return; stats = listener->GetStatus(); @@ -764,8 +764,6 @@ Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata) perfdata->Add("'api_" + kv.first + "'=" + Convert::ToString(kv.second)); status->Set("api", stats.first); - - return 0; } std::pair ApiListener::GetStatus(void) diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp index 49d61d88e..884c1b034 100644 --- a/lib/remote/apilistener.hpp +++ b/lib/remote/apilistener.hpp @@ -59,7 +59,7 @@ public: 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 GetStatus(void); void AddAnonymousClient(const ApiClient::Ptr& aclient);