From 5da4fbde3b501c174ec028b7a7ae036194a5a77e Mon Sep 17 00:00:00 2001 From: Michael Insel Date: Mon, 26 Nov 2018 17:13:58 +0100 Subject: [PATCH] Fix check_perfmon to support non-localized names 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/check_perfmon.cpp b/plugins/check_perfmon.cpp index e9d44cf55..bfe883b2d 100644 --- a/plugins/check_perfmon.cpp +++ b/plugins/check_perfmon.cpp @@ -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; -- 2.40.0