You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
670 B
17 lines
670 B
import requests, arkevars, json, logging
|
|
|
|
logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p',level=logging.INFO,filename='example.log')
|
|
logger = logging.getLogger("arke")
|
|
|
|
def monitor_AllTargets(monitoringtargets):
|
|
for target in monitoringtargets:
|
|
try:
|
|
statuscode = requests.get(target).status_code
|
|
logger.info(f"target: {target} statuscode: {statuscode}")
|
|
# prints the int of the status code. Find more at httpstatusrappers.com :)
|
|
|
|
except requests.ConnectionError:
|
|
logger.warn(f"target: {target} ERROR: Failure to connect.")
|
|
|
|
monitor_AllTargets(arkevars.httpTargets)
|