mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-07-07 12:34:30 +02:00
fix adding router if router peer connection is tunnel
This commit is contained in:
parent
60c4f1870f
commit
1fe9637f50
2 changed files with 7 additions and 3 deletions
|
@ -18,7 +18,7 @@ from libs.db.db_device import Devices,EXCLUDED,database
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import socket
|
import socket
|
||||||
from libs.check_routeros.routeros_check.resource import RouterOSCheckResource
|
from libs.check_routeros.routeros_check.resource import RouterOSCheckResource
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
import json
|
import json
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ def scan_with_ip(*args, **kwargs):
|
||||||
device['update_availble']=is_availbe
|
device['update_availble']=is_availbe
|
||||||
device['upgrade_availble']=upgrade_availble
|
device['upgrade_availble']=upgrade_availble
|
||||||
device['current_firmware']=current
|
device['current_firmware']=current
|
||||||
device['mac']=result['interface']['mac-address']
|
device['mac']=result['interface']['mac-address'] if "mac-address" in result['interface'] else 'tunnel'
|
||||||
device['name']=result['name']
|
device['name']=result['name']
|
||||||
device['details']=result['board-name'] + " " + result['model'] if result['model']!=result['board-name'] else result['model']
|
device['details']=result['board-name'] + " " + result['model'] if result['model']!=result['board-name'] else result['model']
|
||||||
device['uptime']=result['uptime']
|
device['uptime']=result['uptime']
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
# MikroWizard.com , Mikrotik router management solution
|
# MikroWizard.com , Mikrotik router management solution
|
||||||
# Author: sepehr.ha@gmail.com
|
# Author: sepehr.ha@gmail.com
|
||||||
|
|
||||||
|
from logging.config import IDENTIFIER
|
||||||
import pytz
|
import pytz
|
||||||
import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
|
@ -705,7 +706,10 @@ def backup_router(dev):
|
||||||
def store_config(dev,configs):
|
def store_config(dev,configs):
|
||||||
dir=config.BACKUP_DIR
|
dir=config.BACKUP_DIR
|
||||||
#add device mac and curent date to dir
|
#add device mac and curent date to dir
|
||||||
dir=dir+dev.mac+"/"+datetime.datetime.now().strftime("%Y-%m-%d")+"/"
|
identifier=dev.mac
|
||||||
|
if identifier=='tunnel':
|
||||||
|
identifier=identifier+"_devid_"+(str(dev.id))
|
||||||
|
dir=dir+identifier+"/"+datetime.datetime.now().strftime("%Y-%m-%d")+"/"
|
||||||
filename=datetime.datetime.now().strftime("%H-%M-%S")+".txt"
|
filename=datetime.datetime.now().strftime("%H-%M-%S")+".txt"
|
||||||
filedir=dir+filename
|
filedir=dir+filename
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue