From: Per von Zweigbergk Date: Thu, 5 Nov 2015 16:27:41 +0000 (+0100) Subject: Change B/s unit to B to comply with Nagios plugin spec X-Git-Tag: v2.4.2~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8eb55c11560b5be4dfc4a3c9b7df9e13474be8e5;p=icinga2 Change B/s unit to B to comply with Nagios plugin spec Unfortunately B/s is not a valid unit in the Nagios plugin specification. As a bit of a sad workaround, we set the unit to B, which is technically incorrect, but we can't really do much about that without amending the spec... fixes #10544 Signed-off-by: Jean Flach --- diff --git a/plugins/check_network.cpp b/plugins/check_network.cpp index da3ad1935..65d11d890 100644 --- a/plugins/check_network.cpp +++ b/plugins/check_network.cpp @@ -101,7 +101,7 @@ INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoStruct& p std::cout << desc; wprintf( L"\nIt will then output a string looking something like this:\n\n" - L"\tNETWORK WARNING 1131B/s | network=1131B/s;1000;7000;0\n\n" + L"\tNETWORK WARNING 1131B/s | network=1131B;1000;7000;0\n\n" L"\"NETWORK\" being the type of the check, \"WARNING\" the returned status\n" L"and \"1131B/s\" is the returned value.\n" L"The performance data is found behind the \"|\", in order:\n" @@ -190,7 +190,7 @@ INT printOutput(printInfoStruct& printInfo, CONST std::vector& vInte wsFriendlyName = it->name; } boost::algorithm::replace_all(wsFriendlyName, "'", "''"); - tss << L"netI='" << wsFriendlyName << L"';in=" << it->BytesInSec << "B/s;out=" << it->BytesOutSec << L"B/s "; + tss << L"netI='" << wsFriendlyName << L"';in=" << it->BytesInSec << "B;out=" << it->BytesOutSec << L"B "; } if (printInfo.warn.rend(tIn + tOut)) @@ -198,7 +198,7 @@ INT printOutput(printInfoStruct& printInfo, CONST std::vector& vInte if (printInfo.crit.rend(tIn + tOut)) state = CRITICAL; - perfDataFirst << L"network=" << tIn + tOut << L"B/s;" << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";" << L"0; "; + perfDataFirst << L"network=" << tIn + tOut << L"B;" << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";" << L"0; "; switch (state) { case OK: