Skip to content

Commit

Permalink
Fix and update
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCoderCarl committed Apr 23, 2024
1 parent 3696123 commit 0da3d60
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,10 @@ def icmp_requests(hosts: list):
if ping_result.is_alive:
if VERBOSE:
logging.info(
f"Host: {ping_result.address} TEST | Average RTT: {ping_result.avg_rtt} ms | Jitter: {ping_result.jitter} ms"
)
telegram_sender.send_alert_to_telegram(
f"Host: {ping_result.address} TEST | Average RTT: {ping_result.avg_rtt} ms | Jitter: {ping_result.jitter} ms"
f"Host: {ping_result.address} | Average RTT: {ping_result.avg_rtt} ms | Jitter: {ping_result.jitter} ms"
)
else:
logging.info(f"{host} is alive")
telegram_sender.send_alert_to_telegram(f"{host} is alive")
else:
logging.warning(
f"Host: {ping_result.address} | Attempt successfully failed !"
Expand All @@ -95,8 +91,9 @@ def http_requests(hosts: list):
logging.info(f"Going to request {h}")
sleep(1)
response = requests.get(f"http://{h}", timeout=10)
logging.info(response.text)
logging.info(response.headers)
if VERBOSE:
logging.info(response.text)
logging.info(response.headers)

if response.status_code != 200:
telegram_sender.send_alert_to_telegram(
Expand Down

0 comments on commit 0da3d60

Please sign in to comment.