Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
disabled SSL verification for downtimes
Browse files Browse the repository at this point in the history
- disabled SSL verification for scheduling and checking downtimes (could
force issues when used in combination with several proxies)
- fixed typo
  • Loading branch information
stdevel committed Mar 21, 2015
1 parent 8f61973 commit 94e006f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions satprep_prepare_maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def verify():
else:
#get default login if not in cache
if defaultMonUser == "": (defaultMonUser, defaultMonPass) = get_credentials("Monitoring", options.monAuthfile)
result = is_downtime(options.URL, defaultMonUser, defaulMonPass, thisHost, options.userAgent, options.noAuth)
result = is_downtime(options.URL, defaultMonUser, defaultMonPass, thisHost, options.userAgent, options.noAuth)

if result:
#host in downtime
Expand All @@ -95,7 +95,7 @@ def verify():
thisURI = host[host.find("@")+1:host.rfind(":")]
thisCred = host[host.rfind(":")+1:]
thisHost = host[:host.find("@")]
LOGGER.debug("Found differing host/crendials combination for VM '" + thisHost + "' - Monitoring URL: '" + thisURI + "', credentials: '" + thisCred + "'")
LOGGER.debug("Found differing host/crendials combination for VM '" + thisHost + "' - Virtualization URL: '" + thisURI + "', credentials: '" + thisCred + "'")
else:
thisURI = ""
thisCred = ""
Expand Down
4 changes: 2 additions & 2 deletions satprep_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def is_downtime(url, monUsername, monPassword, host, agent, noAuth=False):
if noAuth == False: s.auth = HTTPBasicAuth(monUsername, monPassword)

#send GET request
r = s.get(url+"/cgi-bin/status.cgi?host=all&hostprops=1&style=hostdetail", headers=myHeaders)
r = s.get(url+"/cgi-bin/status.cgi?host=all&hostprops=1&style=hostdetail", headers=myHeaders, verify=False)
try:
LOGGER.debug("Result: {0}".format(r.text))
except:
Expand Down Expand Up @@ -161,7 +161,7 @@ def schedule_downtime(url, monUsername, monPassword, host, hours, comment, agent
if noAuth == False: s.auth = HTTPBasicAuth(monUsername, monPassword)

#send POST request
r = s.post(url+"/cgi-bin/cmd.cgi", data=payload, headers=myHeaders)
r = s.post(url+"/cgi-bin/cmd.cgi", data=payload, headers=myHeaders, verify=False)
try:
LOGGER.debug("Result: {0}".format(r.text))
except:
Expand Down

0 comments on commit 94e006f

Please sign in to comment.