From 88f004a356de6107216844767f8d2f790cdabc0d Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Mon, 22 Jun 2015 12:57:37 +0200 Subject: [PATCH] Decide state based on single drives fixes #9197 --- plugins/check_disk.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/check_disk.cpp b/plugins/check_disk.cpp index 7523f15aa..3a5d1d70f 100644 --- a/plugins/check_disk.cpp +++ b/plugins/check_disk.cpp @@ -204,17 +204,17 @@ INT printOutput(printInfoStruct& printInfo, std::vector& vDrives) 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)); + if (printInfo.crit.rend(it->free, it->cap)) + state = CRITICAL; + if (state == OK && printInfo.warn.rend(it->free, it->cap)) + state = WARNING; } - if (printInfo.warn.rend(tFree, tCap)) { - state = WARNING; + if (state == WARNING) output = L"DISK WARNING - free space:"; - } - if (printInfo.crit.rend(tFree, tCap)) { - state = CRITICAL; + if (state == CRITICAL) output = L"DISK CRITICAL - free space:"; - } std::wcout << output; if (vDrives.size() > 1)