Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit 54196217 authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

start reorg data

parent abc2ccb2
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,9 @@ from typing import Optional, List, Dict, Any
import logging
from logging.handlers import RotatingFileHandler
from requests import head
# import importlib
# import sys
try:
from netifaces import interfaces, ifaddresses, AF_INET, AF_INET6
......@@ -51,19 +54,36 @@ CONFIG_BASE_URL = ''
IMAGES = {}
PLATFORMS = {}
# import global variables
try:
from vars.settings import *
except ModuleNotFoundError:
# (
# BIND_PNP_SERVER,
# PORT,
# TIME_FORMAT,
# STATUS_REFRESH,
# DEBUG,
# LOG_TO_FILE,
# LOG_FILE,
# IMAGE_BASE_URL,
# CONFIG_BASE_URL,
# )
except (ModuleNotFoundError, ImportError):
pass
try:
from vars.images import *
from vars.platforms import *
from vars.images import (
SoftwareImage,
IMAGES,
)
from vars.platforms import (
Model,
PLATFORMS,
)
except ModuleNotFoundError as e:
print(f'{e}')
exit(1)
CONFIG_BASE_URL = CONFIG_BASE_URL.rstrip('/')
IMAGE_BASE_URL = IMAGE_BASE_URL.rstrip('/')
......@@ -463,6 +483,10 @@ def get_local_ip_addresses() -> List[str]:
return _addresses
def reload_data():
pass
@app.route('/')
def root():
return redirect('/status', 302)
......@@ -491,6 +515,9 @@ def buttons():
udi = list(request.form.keys())[0]
button = list(request.form.values())[0]
if button == 'Reload':
reload_data()
if udi in devices.keys():
device = devices[udi]
if button == "Remove":
......
......@@ -33,6 +33,9 @@
</head>
<body>
<h1>PnP Day0 status page</h1>
<form method="post" action="/buttons">
<input type="submit" value="Reload" name="reload_data"/>
</form>
<table>
<tr>
<th><div class="rotate">Count</div></th>
......
......@@ -9,5 +9,5 @@ STATUS_REFRESH = 10
# DEBUG = True
# LOG_TO_FILE = True
# LOG_FILE = 'log/pnp_debug.log'
IMAGE_BASE_URL = 'http://192.168.10.50:8080/images'
CONFIG_BASE_URL = 'http://192.168.10.50:8080/configs'
IMAGE_BASE_URL = 'http://192.168.10.133:8080/images'
CONFIG_BASE_URL = 'http://192.168.10.133:8080/configs'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment