Module: check_mk
Branch: master
Commit: 554cda30438d52661ecb471eaac3e9858c835cf7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=554cda30438d52…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Sep 8 15:46:43 2016 +0200
windows agent: fixed crash when open hardware monitor namespace was unavailable
---
agents/windows/sections/SectionOHM.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/agents/windows/sections/SectionOHM.cc
b/agents/windows/sections/SectionOHM.cc
index 1008665..cf53082 100644
--- a/agents/windows/sections/SectionOHM.cc
+++ b/agents/windows/sections/SectionOHM.cc
@@ -43,7 +43,12 @@ void SectionOHM::startIfAsync() {
}
bool SectionOHM::produceOutputInner(std::ostream &out, const Environment &env) {
- bool res = SectionWMI::produceOutputInner(out, env);
+ bool res = false;
+ try {
+ res = SectionWMI::produceOutputInner(out, env);
+ } catch (const wmi::ComException &e) {
+ res = false;
+ }
if (!res && !_ohm_monitor->checkAvailabe()) {
crash_log("ohm not installed or not runnable -> section disabled");
suspend(3600);