From 62790f110f8988a1bf5a3be128232187a993a3bb Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Sat, 13 Jun 2020 19:16:14 +0200 Subject: [PATCH] F #4302: Treat exception in conect_vcenter --- src/im_mad/remotes/lib/vcenter_cluster.rb | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/im_mad/remotes/lib/vcenter_cluster.rb b/src/im_mad/remotes/lib/vcenter_cluster.rb index ada8564a4f..6f1bd37337 100644 --- a/src/im_mad/remotes/lib/vcenter_cluster.rb +++ b/src/im_mad/remotes/lib/vcenter_cluster.rb @@ -815,20 +815,20 @@ class ClusterSet $logger.info("Monitoring cluster #{id}") CLUSTER_PROBES.each do |probe_name| - # Check if the last monitoring time is older than the - # configured monitoring frequency for the probe - last_mon = c["last_#{probe_name}".to_sym] - probe_frequency = conf[probe_name].to_i - next unless (Time.now.to_i - last_mon) > probe_frequency - - # Refresh the vCenter connection in the least frequent probe - if probe_name.eql?('system_host') - c[:cluster].connect_vcenter - end - - $logger.info("\tRunning #{probe_name} probe") - begin + # Check if the last monitoring time is older than the + # configured monitoring frequency for the probe + last_mon = c["last_#{probe_name}".to_sym] + probe_frequency = conf[probe_name].to_i + next unless (Time.now.to_i - last_mon) > probe_frequency + + # Refresh the vCenter connection in the least frequent probe + if probe_name.eql?('system_host') + c[:cluster].connect_vcenter + end + + $logger.info("\tRunning #{probe_name} probe") + probe_result = c[:cluster].send(probe_name).strip next if probe_result.empty?