From: Jean Flach Date: Wed, 8 Nov 2017 15:53:01 +0000 (+0100) Subject: Make --perf-syntax also change short message X-Git-Tag: v2.9.0~314^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1d1c2e2e8a3f76f8d13318f19f5d98eda1e6a6a;p=icinga2 Make --perf-syntax also change short message refs #5418 --- diff --git a/plugins/check_perfmon.cpp b/plugins/check_perfmon.cpp index fdc0d84b0..d1365163b 100644 --- a/plugins/check_perfmon.cpp +++ b/plugins/check_perfmon.cpp @@ -372,19 +372,19 @@ INT PrintOutput(CONST po::variables_map& vm, printInfoStruct& pi) wssPerfData << pi.dValue << ';' << pi.tWarn.pString() << ';' << pi.tCrit.pString() << ";;"; if (pi.tCrit.rend(pi.dValue)) { - std::wcout << "PERFMON CRITICAL \"" << pi.wsFullPath << "\" = " - << pi.dValue << " | " << wssPerfData.str() << '\n'; + std::wcout << "PERFMON CRITICAL \"" << (vm.count("perf-syntax") ? vm["perf-syntax"].as() : pi.wsFullPath) + << "\" = " << pi.dValue << " | " << wssPerfData.str() << '\n'; return 2; } if (pi.tWarn.rend(pi.dValue)) { - std::wcout << "PERFMON WARNING \"" << pi.wsFullPath << "\" = " - << pi.dValue << " | " << wssPerfData.str() << '\n'; + std::wcout << "PERFMON WARNING \"" << (vm.count("perf-syntax") ? vm["perf-syntax"].as() : pi.wsFullPath) + << "\" = " << pi.dValue << " | " << wssPerfData.str() << '\n'; return 1; } - std::wcout << "PERFMON OK \"" << pi.wsFullPath << "\" = " - << pi.dValue << " | " << wssPerfData.str() << '\n'; + std::wcout << "PERFMON OK \"" << (vm.count("perf-syntax") ? vm["perf-syntax"].as() : pi.wsFullPath) + << "\" = " << pi.dValue << " | " << wssPerfData.str() << '\n'; return 0; }