From ceda55b389bac0853456a2ac95f4724a704a0615 Mon Sep 17 00:00:00 2001 From: Pall Sigurdsson Date: Mon, 23 Apr 2012 12:43:14 +0000 Subject: [PATCH] make sure plugin exits cleanly if unable to run clustat -fx command --- check_rhcs/trunk/check_rhcs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/check_rhcs/trunk/check_rhcs b/check_rhcs/trunk/check_rhcs index dd29676..4ca9d49 100644 --- a/check_rhcs/trunk/check_rhcs +++ b/check_rhcs/trunk/check_rhcs @@ -120,9 +120,12 @@ def main(): usage() sys.exit() - clustatOutput = os.popen('/usr/sbin/clustat -fx') - dom = xml.dom.minidom.parse(clustatOutput) - + try: + clustatOutput = os.popen('/usr/sbin/clustat -fx') + dom = xml.dom.minidom.parse(clustatOutput) + except Exception, e: + print "Error: could not parse output of : '/usr/sbin/clustat -fx': ", e + sys.exit(3) if typeCheck == 'cluster': # First we query for the state of the cluster itself.