mirror of https://github.com/Icinga/icinga2.git
Icinga DB: set value in milliseconds for program_start in stats/heartbeat
This commit is contained in:
parent
4c5f9db982
commit
e46d83b6be
|
@ -1,6 +1,7 @@
|
|||
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
||||
|
||||
#include "icingadb/icingadb.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include "base/json.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/serializer.hpp"
|
||||
|
@ -38,13 +39,14 @@ Dictionary::Ptr IcingaDB::GetStats()
|
|||
}));
|
||||
}
|
||||
|
||||
typedef Dictionary::Ptr DP;
|
||||
DP app = DP(DP(DP(stats->Get("IcingaApplication"))->Get("status"))->Get("icingaapplication"))->Get("app");
|
||||
|
||||
app->Set("program_start", TimestampToMilliseconds(Application::GetStartTime()));
|
||||
|
||||
auto localEndpoint (Endpoint::GetLocalEndpoint());
|
||||
|
||||
if (localEndpoint) {
|
||||
typedef Dictionary::Ptr DP;
|
||||
|
||||
DP(DP(DP(DP(stats->Get("IcingaApplication"))->Get("status"))->Get("icingaapplication"))->Get("app"))
|
||||
->Set("endpoint_id", GetObjectIdentifier(localEndpoint));
|
||||
app->Set("endpoint_id", GetObjectIdentifier(localEndpoint));
|
||||
}
|
||||
|
||||
return stats;
|
||||
|
|
Loading…
Reference in New Issue