This commit is contained in:
@@ -4,8 +4,15 @@ import logging
|
||||
from datetime import datetime
|
||||
|
||||
# Configuration des logs
|
||||
logging.basicConfig(filename='/sdsat/logs/registrator.log', level=logging.INFO,
|
||||
format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
#logging.basicConfig(filename='/sdsat/logs/registrator.log', level=logging.INFO,
|
||||
# format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
|
||||
def configure_logging(log_path="/sdsat/logs/registrator.log"):
|
||||
logging.basicConfig(
|
||||
filename=log_path,
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||
)
|
||||
|
||||
ip='69.69.69.69'
|
||||
|
||||
@@ -31,8 +38,8 @@ def get_public_ip():
|
||||
ip='69.69.69.69'
|
||||
return ip
|
||||
|
||||
def send_to_api(host, IP):
|
||||
url = "http://api.sdsat.fr:8000/registrator"
|
||||
def send_to_api(host, ip):
|
||||
url = "http://api.test-sdsat.fr:8000/registrator"
|
||||
data = {
|
||||
"host": host,
|
||||
"IP": ip,
|
||||
|
||||
Reference in New Issue
Block a user