From 04d25281e3be71ad550318267028122de20dccfe Mon Sep 17 00:00:00 2001 From: gitmopp Date: Thu, 30 Jan 2014 17:36:33 +0100 Subject: [PATCH] Fixed output to be more compatible My SSSU 10.1.0 reports "SSSU for HP P6000 Command View" instead of "SSSU for HP StorageWorks Command View EVA". I fixed the output to just check for SSSU for HP --- check_eva/check_eva.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/check_eva/check_eva.py b/check_eva/check_eva.py index 333b2de..12cfeaf 100644 --- a/check_eva/check_eva.py +++ b/check_eva/check_eva.py @@ -49,7 +49,7 @@ timeout = 0 # 0 means no timeout server_side_troubleshooting = False # No real need to change anything below here -version = "1.0" +version = "1.0.1" ok = 0 warning = 1 critical = 2 @@ -239,15 +239,15 @@ def run_sssu(system=None, command="ls system full"): if output.pop(0).strip() != '': error = 1 if output.pop(0).strip() != '': - error = 1 - if output.pop(0).strip() != 'SSSU for HP StorageWorks Command View EVA': - error = 1 + error = 2 + if output.pop(0).strip().find('SSSU for HP') != 0: + error = 3 if output.pop(0).strip().find('Version:') != 0: - error = 1 + error = 4 if output.pop(0).strip().find('Build:') != 0: - error = 1 + error = 5 if output.pop(0).strip().find('NoSystemSelected> ') != 0: - error = 1 + error = 6 #if output.pop(0).strip() != '': error = 1 #if output.pop(0).strip().find('NoSystemSelected> ') != 0: error=1 #if output.pop(0).strip() != '': error = 1 @@ -260,7 +260,7 @@ def run_sssu(system=None, command="ls system full"): if i.find('information:') > 0: break if error > 0: - print "Error running the sssu command" + print "Error running the sssu command: " + str(error) print commandstring print str_buffer exit(unknown)