mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-03 20:40:17 -05:00
Get string representation of endpoint version
Create a new function with which to get a string representation of that endpoints icinga version.
This commit is contained in:
parent
c0bf592ec9
commit
7bc50d5aa7
2 changed files with 11 additions and 2 deletions
|
|
@ -6,10 +6,8 @@
|
|||
#include "remote/apilistener.hpp"
|
||||
#include "remote/jsonrpcconnection.hpp"
|
||||
#include "remote/zone.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/exception.hpp"
|
||||
#include "base/convert.hpp"
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
|
|
@ -172,3 +170,12 @@ double Endpoint::GetSecondsProcessingMessages() const
|
|||
{
|
||||
return m_InputProcessingTime;
|
||||
}
|
||||
|
||||
String Endpoint::GetIcingaVersionString() const {
|
||||
unsigned long version = GetIcingaVersion();
|
||||
auto bugfix = version % 100;
|
||||
version /= 100;
|
||||
auto minor = version % 100;
|
||||
auto major = version / 100;
|
||||
return String() + std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(bugfix);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ public:
|
|||
|
||||
double GetSecondsProcessingMessages() const override;
|
||||
|
||||
String GetIcingaVersionString() const;
|
||||
|
||||
protected:
|
||||
void OnAllConfigLoaded() override;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue