1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-22 10:23:46 +01:00
This commit is contained in:
Páll Guðjón Sigurðsson 2010-09-02 18:12:32 +00:00
parent dcfc14bc0b
commit 88965ef840

View File

@ -146,7 +146,7 @@ def runCommand(command):
if proc.returncode > 0: if proc.returncode > 0:
print "Error %s: %s\n command was: '%s'" % (proc.returncode,stderr.strip(),command) print "Error %s: %s\n command was: '%s'" % (proc.returncode,stderr.strip(),command)
if proc.returncode == 127: # File not found, lets print path if proc.returncode == 127: # File not found, lets print path
path=os.getenv("PATH") path=getenv("PATH")
print "Current Path: %s" % (path) print "Current Path: %s" % (path)
exit(unknown) exit(unknown)
else: else:
@ -520,9 +520,12 @@ def check_controllers():
def set_path(): def set_path():
global path global path
if path == '':
path = "C:\Program Files\Hewlett-Packard\Sanworks\Element Manager for StorageWorks HSV"
current_path = getenv('PATH') current_path = getenv('PATH')
if path == '':
if current_path.find('C:\\') > 1: # We are on this platform
path = "C:\Program Files\Hewlett-Packard\Sanworks\Element Manager for StorageWorks HSV"
else:
path = "/usr/local/bin"
current_path = "%s:%s" % (current_path,path) current_path = "%s:%s" % (current_path,path)
putenv('PATH', current_path) putenv('PATH', current_path)
set_path() set_path()