]> granicus.if.org Git - icinga2/commitdiff
Implement Application::GetVersion().
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 9 Oct 2013 06:46:10 +0000 (08:46 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 9 Oct 2013 06:46:31 +0000 (08:46 +0200)
Fixes #4801

components/compat/statusdatawriter.cpp
icinga-app/icinga.cpp
lib/base/application.cpp
lib/base/application.h

index 3fb34b25991fceb1bf654f084723940aeef386ff..cd1315a5e8c950d8f78f7a5b9ba8487cc7640097 100644 (file)
@@ -608,7 +608,7 @@ void StatusDataWriter::StatusTimerHandler(void)
 
        statusfp << "info {" << "\n"
                 << "\t" << "created=" << Utility::GetTime() << "\n"
-                << "\t" << "version=2.0" << "\n"
+                << "\t" << "version=" << Application::GetVersion() << "\n"
                 << "\t" << "}" << "\n"
                 << "\n";
 
index f8b6662529c89ee33621841d44c01a8c80aeea51..0dc9acfcdd99eb083c567a044b5eeebad08f38da 100644 (file)
@@ -32,9 +32,6 @@
 #include <boost/foreach.hpp>
 
 #ifndef _WIN32
-#      include "icinga-version.h"
-#      define ICINGA_VERSION VERSION ", " GIT_MESSAGE
-
 #      include <ltdl.h>
 #      include <sys/types.h>
 #      include <pwd.h>
@@ -290,9 +287,7 @@ int main(int argc, char **argv)
                std::cout << appName << " " << "- The Icinga 2 network monitoring daemon.";
 
                if (g_AppParams.count("version")) {
-#ifndef _WIN32
-                       std::cout  << " (Version: " << ICINGA_VERSION << ")";
-#endif /* _WIN32 */
+                       std::cout  << " (Version: " << Application::GetVersion() << ")";
                        std::cout << std::endl
                                  << "Copyright (c) 2012-2013 Icinga Development Team (http://www.icinga.org)" << std::endl
                                  << "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>" << std::endl
index 7bd943e7c8d4345cd8a7e02291752feb3ddf9f90..3ba47522ae24a5837aeba0587dd5ac5c1eeb2bfc 100644 (file)
@@ -705,3 +705,8 @@ ThreadPool& Application::GetTP(void)
        static ThreadPool tp;
        return tp;
 }
+
+String Application::GetVersion(void)
+{
+       return ICINGA_VERSION;
+}
index b8ec5c73d2dddcedf6c091062ab78fc45c70c310..878fd3aa944ffe276c9266ad3a143bc3d1a7b018 100644 (file)
@@ -23,6 +23,8 @@
 #include "base/i2-base.h"
 #include "base/threadpool.h"
 #include "base/dynamicobject.h"
+#include "icinga-version.h"
+#define ICINGA_VERSION VERSION ", " GIT_MESSAGE
 
 namespace icinga {
 
@@ -92,6 +94,8 @@ public:
 
        static ThreadPool& GetTP(void);
 
+       static String GetVersion(void);
+
 protected:
        virtual void OnConfigLoaded(void);
        virtual void Stop(void);