mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-12 16:24:41 +02:00
Merge pull request #8998 from Icinga/bugfix/icingadb-program-start-milliseconds
Icinga DB: set value in milliseconds for program_start in stats/heartbeat
This commit is contained in:
commit
848f1ae167
@ -1,6 +1,7 @@
|
|||||||
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
||||||
|
|
||||||
#include "icingadb/icingadb.hpp"
|
#include "icingadb/icingadb.hpp"
|
||||||
|
#include "base/application.hpp"
|
||||||
#include "base/json.hpp"
|
#include "base/json.hpp"
|
||||||
#include "base/logger.hpp"
|
#include "base/logger.hpp"
|
||||||
#include "base/serializer.hpp"
|
#include "base/serializer.hpp"
|
||||||
@ -38,13 +39,14 @@ Dictionary::Ptr IcingaDB::GetStats()
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto localEndpoint (Endpoint::GetLocalEndpoint());
|
|
||||||
|
|
||||||
if (localEndpoint) {
|
|
||||||
typedef Dictionary::Ptr DP;
|
typedef Dictionary::Ptr DP;
|
||||||
|
DP app = DP(DP(DP(stats->Get("IcingaApplication"))->Get("status"))->Get("icingaapplication"))->Get("app");
|
||||||
|
|
||||||
DP(DP(DP(DP(stats->Get("IcingaApplication"))->Get("status"))->Get("icingaapplication"))->Get("app"))
|
app->Set("program_start", TimestampToMilliseconds(Application::GetStartTime()));
|
||||||
->Set("endpoint_id", GetObjectIdentifier(localEndpoint));
|
|
||||||
|
auto localEndpoint (Endpoint::GetLocalEndpoint());
|
||||||
|
if (localEndpoint) {
|
||||||
|
app->Set("endpoint_id", GetObjectIdentifier(localEndpoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
return stats;
|
return stats;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user