1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-22 10:23:46 +01:00

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
This commit is contained in:
gitmopp 2014-01-30 17:36:33 +01:00
parent 9b2474fb49
commit 04d25281e3

View File

@ -49,7 +49,7 @@ timeout = 0 # 0 means no timeout
server_side_troubleshooting = False server_side_troubleshooting = False
# No real need to change anything below here # No real need to change anything below here
version = "1.0" version = "1.0.1"
ok = 0 ok = 0
warning = 1 warning = 1
critical = 2 critical = 2
@ -239,15 +239,15 @@ def run_sssu(system=None, command="ls system full"):
if output.pop(0).strip() != '': if output.pop(0).strip() != '':
error = 1 error = 1
if output.pop(0).strip() != '': if output.pop(0).strip() != '':
error = 1 error = 2
if output.pop(0).strip() != 'SSSU for HP StorageWorks Command View EVA': if output.pop(0).strip().find('SSSU for HP') != 0:
error = 1 error = 3
if output.pop(0).strip().find('Version:') != 0: if output.pop(0).strip().find('Version:') != 0:
error = 1 error = 4
if output.pop(0).strip().find('Build:') != 0: if output.pop(0).strip().find('Build:') != 0:
error = 1 error = 5
if output.pop(0).strip().find('NoSystemSelected> ') != 0: if output.pop(0).strip().find('NoSystemSelected> ') != 0:
error = 1 error = 6
#if output.pop(0).strip() != '': error = 1 #if output.pop(0).strip() != '': error = 1
#if output.pop(0).strip().find('NoSystemSelected> ') != 0: error=1 #if output.pop(0).strip().find('NoSystemSelected> ') != 0: error=1
#if output.pop(0).strip() != '': 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: if i.find('information:') > 0:
break break
if error > 0: if error > 0:
print "Error running the sssu command" print "Error running the sssu command: " + str(error)
print commandstring print commandstring
print str_buffer print str_buffer
exit(unknown) exit(unknown)