MCPcopy Create free account
hub / github.com/Icinga/icinga2 / StatsFunc

Method StatsFunc

lib/icinga/icingaapplication.cpp:75–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73REGISTER_STATSFUNCTION(IcingaApplication, &IcingaApplication::StatsFunc);
74
75void IcingaApplication::StatsFunc(const Dictionary::Ptr& status, [[maybe_unused]] const Array::Ptr& perfdata)
76{
77 DictionaryData nodes;
78
79 for (const IcingaApplication::Ptr& icingaapplication : ConfigType::GetObjectsByType<IcingaApplication>()) {
80 nodes.emplace_back(icingaapplication->GetName(), new Dictionary({
81 { "node_name", icingaapplication->GetNodeName() },
82 { "enable_notifications", icingaapplication->GetEnableNotifications() },
83 { "enable_event_handlers", icingaapplication->GetEnableEventHandlers() },
84 { "enable_flapping", icingaapplication->GetEnableFlapping() },
85 { "enable_host_checks", icingaapplication->GetEnableHostChecks() },
86 { "enable_service_checks", icingaapplication->GetEnableServiceChecks() },
87 { "enable_perfdata", icingaapplication->GetEnablePerfdata() },
88 { "environment", icingaapplication->GetEnvironment() },
89 { "pid", Utility::GetPid() },
90 { "program_start", Application::GetStartTime() },
91 { "version", Application::GetAppVersion() }
92 }));
93 }
94
95 status->Set("icingaapplication", new Dictionary(std::move(nodes)));
96}
97
98/**
99 * The entry point for the Icinga application.

Callers

nothing calls this directly

Calls 4

GetNodeNameMethod · 0.80
GetEnvironmentMethod · 0.80
GetNameMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected