Decide state based on single drives

fixes #9197
This commit is contained in:
Jean Flach 2015-06-22 12:57:37 +02:00 committed by Jean-Marcel Flach
parent c1e13d3dbe
commit 1a5117fe0a
1 changed files with 6 additions and 6 deletions

View File

@ -204,18 +204,18 @@ INT printOutput(printInfoStruct& printInfo, std::vector<drive>& vDrives)
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;" printInfo.warn.pString(it->cap) + L";" + printInfo.crit.pString(it->cap) + L";0;"
+ removeZero(it->cap)); + removeZero(it->cap));
} if (printInfo.crit.rend(it->free, it->cap))
if (printInfo.warn.rend(tFree, tCap)) {
state = WARNING;
output = L"DISK WARNING - free space:";
}
if (printInfo.crit.rend(tFree, tCap)) {
state = CRITICAL; state = CRITICAL;
output = L"DISK CRITICAL - free space:"; if (state == OK && printInfo.warn.rend(it->free, it->cap))
state = WARNING;
} }
if (state == WARNING)
output = L"DISK WARNING - free space:";
if (state == CRITICAL)
output = L"DISK CRITICAL - free space:";
std::wcout << output; std::wcout << output;
if (vDrives.size() > 1) if (vDrives.size() > 1)
std::wcout << "Total " << tFree << unit << " (" << removeZero(std::round(tFree/tCap * 100.0)) << "%); "; std::wcout << "Total " << tFree << unit << " (" << removeZero(std::round(tFree/tCap * 100.0)) << "%); ";