]> granicus.if.org Git - icinga2/commitdiff
Fix check_perfmon to support non-localized names 6800/head
authorMichael Insel <michael@insel.email>
Mon, 26 Nov 2018 16:13:58 +0000 (17:13 +0100)
committerMichael Insel <michael@insel.email>
Mon, 26 Nov 2018 16:18:38 +0000 (17:18 +0100)
This fixes check_perfmon to support non-localized names on localized
Windows machines. The fix handles the given performance counter by
default as non-localized name, if none is found it falls back to the
localized name.

refs #5546

plugins/check_perfmon.cpp

index e9d44cf55e3f1a9358504578642de74b313a43e1..bfe883b2d86dde75a447724f04b8edb9380055c4 100644 (file)
@@ -297,7 +297,11 @@ bool QueryPerfData(printInfoStruct& pI)
        if (FAILED(status))
                goto die;
 
-       status = PdhAddCounter(hQuery, pI.wsFullPath.c_str(), NULL, &hCounter);
+       status = PdhAddEnglishCounter(hQuery, pI.wsFullPath.c_str(), NULL, &hCounter);
+
+       if (FAILED(status))
+               status = PdhAddCounter(hQuery, pI.wsFullPath.c_str(), NULL, &hCounter);
+
        if (FAILED(status))
                goto die;