Single quotes are allowed, double quotes are not.
wsDrives.push_back(it->name + L" " + removeZero(it->free) + L" " + unit + L" (" +
removeZero(std::round(it->free / it->cap * 100.0)) + L"%); ");
- wsPerf.push_back(L" " + it->name + L"=" + removeZero(it->free) + unit + L";" +
+ wsPerf.push_back(L" '" + it->name + L"'=" + removeZero(it->free) + unit + L";" +
printInfo.warn.pString(it->cap) + L";" + printInfo.crit.pString(it->cap) + L";0;"
+ removeZero(it->cap));
break;
}
- std::wcout << " " << printInfo.load << L"% | load=" << printInfo.load << L"%;"
+ std::wcout << " " << printInfo.load << L"% | 'load'=" << printInfo.load << L"%;"
<< printInfo.warn.pString() << L";"
<< printInfo.crit.pString() << L";0;100" << '\n';
else
std::wcout << " - " << 100 - printInfo.percentFree << L"% used";
- std::wcout << "| memory=" << currentValue << BunitStr(printInfo.unit) << L";"
+ std::wcout << "| 'memory'=" << currentValue << BunitStr(printInfo.unit) << L";"
<< printInfo.warn.pString(printInfo.tRam) << L";" << printInfo.crit.pString(printInfo.tRam)
<< L";0;" << printInfo.tRam;
continue;
} else {
boost::algorithm::replace_all(wsFriendlyName, "'", "''");
- tss << L"\'" << wsFriendlyName << L"_in\'=" << it->BytesInSec << L"B \'" << wsFriendlyName << L"_out\'=" << it->BytesOutSec << L"B ";
+ tss << L"'" << wsFriendlyName << L"_in'=" << it->BytesInSec << L"B '" << wsFriendlyName << L"_out'=" << it->BytesOutSec << L"B ";
}
}
}
std::wcout << " " << tIn + tOut << L"B/s | "
- << L"network=" << tIn + tOut << L"B;" << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";" << L"0; "
+ << L"'network'=" << tIn + tOut << L"B;" << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";" << L"0; "
<< tss.str() << '\n';
return state;
std::wstringstream wssPerfData;
if (vm.count("perf-syntax"))
- wssPerfData << "\"" << vm["perf-syntax"].as<std::wstring>() << "\"=";
+ wssPerfData << "'" << vm["perf-syntax"].as<std::wstring>() << "'=";
else
- wssPerfData << "\"" << pi.wsFullPath << "\"=";
+ wssPerfData << "'" << pi.wsFullPath << "'=";
wssPerfData << pi.dValue << ';' << pi.tWarn.pString() << ';' << pi.tCrit.pString() << ";;";
if (pi.tCrit.rend(pi.dValue)) {
- std::wcout << "PERFMON CRITICAL \"" << (vm.count("perf-syntax") ? vm["perf-syntax"].as<std::wstring>() : pi.wsFullPath)
- << "\" = " << pi.dValue << " | " << wssPerfData.str() << '\n';
+ std::wcout << "PERFMON CRITICAL for '" << (vm.count("perf-syntax") ? vm["perf-syntax"].as<std::wstring>() : pi.wsFullPath)
+ << "' = " << pi.dValue << " | " << wssPerfData.str() << "\n";
return 2;
}
if (pi.tWarn.rend(pi.dValue)) {
- std::wcout << "PERFMON WARNING \"" << (vm.count("perf-syntax") ? vm["perf-syntax"].as<std::wstring>() : pi.wsFullPath)
- << "\" = " << pi.dValue << " | " << wssPerfData.str() << '\n';
+ std::wcout << "PERFMON WARNING for '" << (vm.count("perf-syntax") ? vm["perf-syntax"].as<std::wstring>() : pi.wsFullPath)
+ << "' = " << pi.dValue << " | " << wssPerfData.str() << "\n";
return 1;
}
- std::wcout << "PERFMON OK \"" << (vm.count("perf-syntax") ? vm["perf-syntax"].as<std::wstring>() : pi.wsFullPath)
- << "\" = " << pi.dValue << " | " << wssPerfData.str() << '\n';
+ std::wcout << "PERFMON OK for '" << (vm.count("perf-syntax") ? vm["perf-syntax"].as<std::wstring>() : pi.wsFullPath)
+ << "' = " << pi.dValue << " | " << wssPerfData.str() << "\n";
+
return 0;
}
state state = OK;
if (!printInfo.ServiceState) {
- std::wcout << L"SERVICE CRITICAL NOTFOUND | service=" << printInfo.ServiceState << ";;;1;7" << '\n';
+ std::wcout << L"SERVICE CRITICAL NOT FOUND | 'service'=" << printInfo.ServiceState << ";;;1;7" << '\n';
return 3;
}
switch (state) {
case OK:
- std::wcout << L"SERVICE \"" << printInfo.service << "\" OK RUNNING | service=4;;;1;7" << '\n';
+ std::wcout << L"SERVICE \"" << printInfo.service << "\" OK RUNNING | 'service'=4;;;1;7" << '\n';
break;
case WARNING:
- std::wcout << L"SERVICE \"" << printInfo.service << "\" WARNING NOT RUNNING | service=" << printInfo.ServiceState << ";;;1;7" << '\n';
+ std::wcout << L"SERVICE \"" << printInfo.service << "\" WARNING NOT RUNNING | 'service'=" << printInfo.ServiceState << ";;;1;7" << '\n';
break;
case CRITICAL:
- std::wcout << L"SERVICE \"" << printInfo.service << "\" CRITICAL NOT RUNNING | service=" << printInfo.ServiceState << ";;;1;7" << '\n';
+ std::wcout << L"SERVICE \"" << printInfo.service << "\" CRITICAL NOT RUNNING | 'service'=" << printInfo.ServiceState << ";;;1;7" << '\n';
break;
}
switch (state) {
case OK:
- std::wcout << L"SWAP OK - " << printInfo.percentFree << L"% free | swap=" << printInfo.aSwap << BunitStr(printInfo.unit) << L";"
+ std::wcout << L"SWAP OK - " << printInfo.percentFree << L"% free | 'swap'=" << printInfo.aSwap << BunitStr(printInfo.unit) << L";"
<< printInfo.warn.pString(printInfo.tSwap) << L";" << printInfo.crit.pString(printInfo.tSwap)
<< L";0;" << printInfo.tSwap << '\n';
break;
case WARNING:
- std::wcout << L"SWAP WARNING - " << printInfo.percentFree << L"% free | swap=" << printInfo.aSwap << BunitStr(printInfo.unit) << L";"
+ std::wcout << L"SWAP WARNING - " << printInfo.percentFree << L"% free | 'swap'=" << printInfo.aSwap << BunitStr(printInfo.unit) << L";"
<< printInfo.warn.pString(printInfo.tSwap) << L";" << printInfo.crit.pString(printInfo.tSwap)
<< L";0;" << printInfo.tSwap << '\n';
break;
case CRITICAL:
- std::wcout << L"SWAP CRITICAL - " << printInfo.percentFree << L"% free | swap=" << printInfo.aSwap << BunitStr(printInfo.unit) << L";"
+ std::wcout << L"SWAP CRITICAL - " << printInfo.percentFree << L"% free | 'swap'=" << printInfo.aSwap << BunitStr(printInfo.unit) << L";"
<< printInfo.warn.pString(printInfo.tSwap) << L";" << printInfo.crit.pString(printInfo.tSwap)
<< L";0;" << printInfo.tSwap << '\n';
break;
break;
}
- std::wcout << output << printInfo.numUpdates << L" | update=" << printInfo.numUpdates << L";"
+ std::wcout << output << printInfo.numUpdates << L" | 'update'=" << printInfo.numUpdates << L";"
<< printInfo.warn << L";" << printInfo.crit << L";0;" << '\n';
return state;
switch (state) {
case OK:
- std::wcout << L"UPTIME OK " << printInfo.time << TunitStr(printInfo.unit) << L" | uptime=" << printInfo.time
+ std::wcout << L"UPTIME OK " << printInfo.time << TunitStr(printInfo.unit) << L" | 'uptime'=" << printInfo.time
<< TunitStr(printInfo.unit) << L";" << printInfo.warn.pString() << L";"
<< printInfo.crit.pString() << L";0;" << '\n';
break;
case WARNING:
- std::wcout << L"UPTIME WARNING " << printInfo.time << TunitStr(printInfo.unit) << L" | uptime=" << printInfo.time
+ std::wcout << L"UPTIME WARNING " << printInfo.time << TunitStr(printInfo.unit) << L" | 'uptime'=" << printInfo.time
<< TunitStr(printInfo.unit) << L";" << printInfo.warn.pString() << L";"
<< printInfo.crit.pString() << L";0;" << '\n';
break;
case CRITICAL:
- std::wcout << L"UPTIME CRITICAL " << printInfo.time << TunitStr(printInfo.unit) << L" | uptime=" << printInfo.time
+ std::wcout << L"UPTIME CRITICAL " << printInfo.time << TunitStr(printInfo.unit) << L" | 'uptime'=" << printInfo.time
<< TunitStr(printInfo.unit) << L";" << printInfo.warn.pString() << L";"
<< printInfo.crit.pString() << L";0;" << '\n';
break;
switch (state) {
case OK:
- std::wcout << L"USERS OK " << printInfo.users << L" User(s) logged in | users=" << printInfo.users << L";"
+ std::wcout << L"USERS OK " << printInfo.users << L" User(s) logged in | 'users'=" << printInfo.users << L";"
<< printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";0;" << '\n';
break;
case WARNING:
- std::wcout << L"USERS WARNING " << printInfo.users << L" User(s) logged in | users=" << printInfo.users << L";"
+ std::wcout << L"USERS WARNING " << printInfo.users << L" User(s) logged in | 'users'=" << printInfo.users << L";"
<< printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";0;" << '\n';
break;
case CRITICAL:
- std::wcout << L"USERS CRITICAL " << printInfo.users << L" User(s) logged in | users=" << printInfo.users << L";"
+ std::wcout << L"USERS CRITICAL " << printInfo.users << L" User(s) logged in | 'users'=" << printInfo.users << L";"
<< printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";0;" << '\n';
break;
}