]> granicus.if.org Git - icinga2/commitdiff
Fix check_service returning Warning instead of Critical 5851/head
authorJean Flach <jean-marcel.flach@icinga.com>
Wed, 13 Dec 2017 16:48:16 +0000 (17:48 +0100)
committerJean Flach <jean-marcel.flach@icinga.com>
Thu, 14 Dec 2017 10:22:43 +0000 (11:22 +0100)
fixes #5849

plugins/check_service.cpp

index f5f0f463b46ec5676f6bedc7a7b94cdf085a966f..fa730e297464123a7f8c9d59362a729c88233ae9 100644 (file)
@@ -126,9 +126,7 @@ INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoStruct& p
 
        printInfo.service = vm["service"].as<std::wstring>();
 
-       if (vm.count("warn")) {
-               printInfo.warn = true;
-       }
+       printInfo.warn = vm.count("warn");
 
        if (vm.count("D"))
                debug = TRUE;
@@ -157,10 +155,10 @@ INT printOutput(CONST printInfoStruct& printInfo)
                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;
        }