]> granicus.if.org Git - icinga2/commitdiff
Decide state based on single drives
authorJean Flach <jean-marcel.flach@netways.de>
Mon, 22 Jun 2015 10:57:37 +0000 (12:57 +0200)
committerJean-Marcel Flach <jean-marcel.flach@netways.de>
Tue, 23 Jun 2015 13:39:12 +0000 (15:39 +0200)
fixes #9197

plugins/check_disk.cpp

index 7523f15aa6a00206e33ee652870054d5de09b0fa..3a5d1d70fb3af5fe0040941e67fac7d5ff4bbdc6 100644 (file)
@@ -204,17 +204,17 @@ INT printOutput(printInfoStruct& printInfo, std::vector<drive>& 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)