Skip to content

Commit

Permalink
Blacked and isorted
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCoderCarl committed Apr 23, 2024
1 parent 59e80c2 commit 481b282
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,16 @@ def http_requests(hosts: list):
logging.info(f"Going to request {h}")
sleep(1)
response = requests.get(f"http://{h}")
logging.info(f"{response.status_code} is type {type(response.status_code)}")
logging.info(
f"{response.status_code} is type {type(response.status_code)}"
)
logging.info(response.text)
logging.info(response.headers)
logging.info(response.ok)
if response.status_code != 200:
telegram_sender.send_alert_to_telegram(f"Status code: {response.status_code} for this host: {h}")
telegram_sender.send_alert_to_telegram(
f"Status code: {response.status_code} for this host: {h}"
)
except requests.exceptions.SSLError as ssl_err:
telegram_sender.send_alert_to_telegram(f"{h} and {ssl_err}")
except requests.exceptions.ConnectionError as con_err:
Expand Down

0 comments on commit 481b282

Please sign in to comment.