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

Function printObjectInfo

plugins/check_perfmon.cpp:233–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233static void printObjectInfo(const printInfoStruct& pI)
234{
235 if (pI.wsFullPath.empty()) {
236 std::wcout << "No object given!\n";
237 return;
238 }
239
240 std::vector<std::wstring> vecInstances, vecCounters;
241
242 if (!getInstancesAndCountersOfObject(pI.wsFullPath, vecInstances, vecCounters)) {
243 std::wcout << "Could not enumerate instances and counters of " << pI.wsFullPath << '\n'
244 << "Make sure it exists!\n";
245 return;
246 }
247
248 std::wcout << "Instances of " << pI.wsFullPath << ":\n";
249 if (vecInstances.empty())
250 std::wcout << "> Has no instances\n";
251 else {
252 for (const auto& instance : vecInstances)
253 std::wcout << "> " << instance << '\n';
254 }
255 std::wcout << std::endl;
256
257 std::wcout << "Performance Counters of " << pI.wsFullPath << ":\n";
258 if (vecCounters.empty())
259 std::wcout << "> Has no counters\n";
260 else {
261 for (const auto& counter : vecCounters)
262 std::wcout << "> " << counter << "\n";
263 }
264 std::wcout << std::endl;
265}
266
267bool QueryPerfData(printInfoStruct& pI)
268{

Callers 1

wmainFunction · 0.85

Calls 2

emptyMethod · 0.45

Tested by

no test coverage detected