mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-03-28 17:32:36 +01:00
📊
This commit is contained in:
@@ -12,4 +12,6 @@ Example to log to disk only INFO and higher (ignore DEBUG)
|
||||
```
|
||||
*log.py
|
||||
file_handler.setLevel(logging.INFO) # DEBUG used by default for system logs to disk example here shows INFO
|
||||
```
|
||||
```
|
||||
|
||||
Reporting is via [logs/mesh_network_analyzer.py](logs/mesh_network_analyzer.py) static log analysis to a HTML report file.
|
||||
@@ -6,6 +6,10 @@ import json
|
||||
import platform
|
||||
import subprocess
|
||||
|
||||
# global variables
|
||||
LOG_PATH = '/opt/meshing-around/logs'
|
||||
W3_PATH = '/var/www/html'
|
||||
|
||||
def parse_log_file(file_path):
|
||||
with open(file_path, 'r') as file:
|
||||
lines = file.readlines()
|
||||
@@ -515,7 +519,7 @@ def generate_hosts_html(system_info):
|
||||
return template.safe_substitute(system_info)
|
||||
|
||||
def main():
|
||||
log_dir = '/opt/meshing-around/logs'
|
||||
log_dir = LOG_PATH
|
||||
today = datetime.now().strftime('%Y_%m_%d')
|
||||
log_file = f'meshbot{today}.log'
|
||||
log_path = os.path.join(log_dir, log_file)
|
||||
@@ -527,7 +531,7 @@ def main():
|
||||
network_map_html = generate_network_map_html(log_data)
|
||||
hosts_html = generate_hosts_html(system_info)
|
||||
|
||||
output_dir = '/var/www/html'
|
||||
output_dir = W3_PATH
|
||||
index_path = os.path.join(output_dir, 'index.html')
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user