File header alignment. (0.25.1)
This commit is contained in:
parent
f6c42040bb
commit
1b11cfdadc
47 changed files with 137 additions and 110 deletions
2
LICENSE
2
LICENSE
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2022 Johannes Findeisen
|
Copyright (c) 2013-2023 Johannes Findeisen
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
#!/usr/bin/python3 -d
|
#!/usr/bin/python3 -d
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: VERY IMPORTANT! IMPLEMENT ERROR HANDLING ALL THE WAY...!!!
|
# TODO: VERY IMPORTANT! IMPLEMENT ERROR HANDLING ALL THE WAY...!!!
|
||||||
# Only exit execution on critical core errors. Do not exit when monitors are failing on
|
# Only exit execution on critical core errors. Do not exit when monitors are failing on
|
||||||
# configuration and execution, but log these errors.
|
# configuration and execution, but log these errors.
|
||||||
|
|
|
||||||
5
bin/lish
5
bin/lish
|
|
@ -1,9 +1,10 @@
|
||||||
#!/usr/bin/python3 -d
|
#!/usr/bin/python3 -d
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: Make use of the "rich" library to for rich text and beautiful formatting in the terminal.
|
# TODO: Make use of the "rich" library to for rich text and beautiful formatting in the terminal.
|
||||||
import argparse
|
import argparse
|
||||||
# TODO: Remove logging in the client and barf output to the terminal directly in Lish. Implement a
|
# TODO: Remove logging in the client and barf output to the terminal directly in Lish. Implement a
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
#!/usr/bin/python3 -d
|
#!/usr/bin/python3 -d
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE for more details.
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: Make this a curses style TUI interface for Linspector using urwid or maybe some more modern
|
# TODO: Make this a curses style TUI interface for Linspector using urwid or maybe some more modern
|
||||||
# framework like textual. Look at the Lish code for more details about backend implementation and
|
# framework like textual. Look at the Lish code for more details about backend implementation and
|
||||||
# the general idea for implementing Linspector clients.
|
# the general idea for implementing Linspector clients.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Database:
|
class Database:
|
||||||
def __init__(self, configuration, environment, log):
|
def __init__(self, configuration, environment, log):
|
||||||
self._configuration = configuration
|
self._configuration = configuration
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.database import Database
|
from linspector.database import Database
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pymysql.cursors
|
import pymysql.cursors
|
||||||
|
|
||||||
from linspector.database import Database
|
from linspector.database import Database
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Environment:
|
class Environment:
|
||||||
"""
|
"""
|
||||||
Object for storing environment variables at runtime. These variables must not affect the
|
Object for storing environment variables at runtime. These variables must not affect the
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import importlib
|
import importlib
|
||||||
import random
|
import random
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import atexit
|
import atexit
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# This class can maybe be used for a general data model for Linspector data processing. currently
|
# This class can maybe be used for a general data model for Linspector data processing. currently
|
||||||
# the is no use for it and no place known where it could be used with sense.
|
# the is no use for it and no place known where it could be used with sense.
|
||||||
class Model:
|
class Model:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import importlib
|
import importlib
|
||||||
import time
|
import time
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Notification:
|
class Notification:
|
||||||
def __init__(self, configuration, environment, log):
|
def __init__(self, configuration, environment, log):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.notification import Notification
|
from linspector.notification import Notification
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.notification import Notification
|
from linspector.notification import Notification
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.notification import Notification
|
from linspector.notification import Notification
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.notification import Notification
|
from linspector.notification import Notification
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Plugin:
|
class Plugin:
|
||||||
def __init__(self, configuration, environment, linspector, log):
|
def __init__(self, configuration, environment, linspector, log):
|
||||||
self._configuration = configuration
|
self._configuration = configuration
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: Make this a backend API using the modern FastAPI framework as a replacement for the
|
# TODO: Make this a backend API using the modern FastAPI framework as a replacement for the
|
||||||
# traditional RPC plugin. Maybe it makes sense to maintain the RPC plugin too for simple usage by
|
# traditional RPC plugin. Maybe it makes sense to maintain the RPC plugin too for simple usage by
|
||||||
# the Lish but I believe it makes sense to only create one backend for all clients.
|
# the Lish but I believe it makes sense to only create one backend for all clients.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import cherrypy
|
import cherrypy
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: This plugin should become the internal Lish implemented as a plugin which does not use the
|
# TODO: This plugin should become the internal Lish implemented as a plugin which does not use the
|
||||||
# API plugin but loads at the end when starting Linspector in interactive mode as a terminal like
|
# API plugin but loads at the end when starting Linspector in interactive mode as a terminal like
|
||||||
# interface to the core of Linspector.
|
# interface to the core of Linspector.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.plugin import Plugin
|
from linspector.plugin import Plugin
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: Think about this idea it little bit more. Maybe Syslog support should not become a plugin
|
# TODO: Think about this idea it little bit more. Maybe Syslog support should not become a plugin
|
||||||
# but should better be implemented in the core.
|
# but should better be implemented in the core.
|
||||||
from linspector.plugin import Plugin
|
from linspector.plugin import Plugin
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Service:
|
class Service:
|
||||||
def __init__(self, configuration, environment, log):
|
def __init__(self, configuration, environment, log):
|
||||||
self._configuration = configuration
|
self._configuration = configuration
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import calendar
|
import calendar
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
@ -30,11 +31,11 @@ class SpeedtestService(Service):
|
||||||
while True:
|
while True:
|
||||||
tmp_time = time.localtime(calendar.timegm(time.gmtime()))
|
tmp_time = time.localtime(calendar.timegm(time.gmtime()))
|
||||||
self._environment.set_env_var('_speedtest_last_run_date',
|
self._environment.set_env_var('_speedtest_last_run_date',
|
||||||
time.strftime('%Y-%m-%d %H:%M:%S',
|
time.strftime('%Y-%m-%d %H:%M:%S',
|
||||||
tmp_time))
|
tmp_time))
|
||||||
|
|
||||||
self._environment.set_env_var('_speedtest_last_run_timestamp',
|
self._environment.set_env_var('_speedtest_last_run_timestamp',
|
||||||
calendar.timegm(time.gmtime()))
|
calendar.timegm(time.gmtime()))
|
||||||
|
|
||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
request = requests.get(self._configuration.get_speedtest_url(), stream=True)
|
request = requests.get(self._configuration.get_speedtest_url(), stream=True)
|
||||||
|
|
@ -56,18 +57,18 @@ class SpeedtestService(Service):
|
||||||
|
|
||||||
self._speedtest_average_speed = total_mbps / total_chunks
|
self._speedtest_average_speed = total_mbps / total_chunks
|
||||||
self._environment.set_env_var('_speedtest_average_speed_megabyte_per_second',
|
self._environment.set_env_var('_speedtest_average_speed_megabyte_per_second',
|
||||||
str(round(self._speedtest_average_speed)))
|
str(round(self._speedtest_average_speed)))
|
||||||
|
|
||||||
self._speedtest_maximum_speed = maximum_speed
|
self._speedtest_maximum_speed = maximum_speed
|
||||||
self._environment.set_env_var('_speedtest_maximum_speed_megabyte_per_second',
|
self._environment.set_env_var('_speedtest_maximum_speed_megabyte_per_second',
|
||||||
str(round(self._speedtest_maximum_speed)))
|
str(round(self._speedtest_maximum_speed)))
|
||||||
|
|
||||||
self._speedtest_time_elapsed = time.perf_counter() - start
|
self._speedtest_time_elapsed = time.perf_counter() - start
|
||||||
self._environment.set_env_var('_speedtest_time_elapsed',
|
self._environment.set_env_var('_speedtest_time_elapsed',
|
||||||
str(self._speedtest_time_elapsed))
|
str(self._speedtest_time_elapsed))
|
||||||
self._log.info('speedtest average: ' + str(self._speedtest_average_speed) +
|
self._log.info('speedtest average: ' + str(self._speedtest_average_speed) +
|
||||||
', max: ' + str(self._speedtest_maximum_speed) +
|
', max: ' + str(self._speedtest_maximum_speed) +
|
||||||
', time: ' + str(self._speedtest_time_elapsed))
|
', time: ' + str(self._speedtest_time_elapsed))
|
||||||
else:
|
else:
|
||||||
self._log.warning('could not calculate download speed!')
|
self._log.warning('could not calculate download speed!')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pprint
|
import pprint
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license)
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license)
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from fritzconnection.lib.fritzstatus import FritzStatus
|
from fritzconnection.lib.fritzstatus import FritzStatus
|
||||||
|
|
||||||
from linspector.service import Service
|
from linspector.service import Service
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
|
# see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Task:
|
class Task:
|
||||||
def __init__(self, configuration, environment, log, **kwargs):
|
def __init__(self, configuration, environment, log, **kwargs):
|
||||||
self._args = {}
|
self._args = {}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.task import Task
|
from linspector.task import Task
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.task import Task
|
from linspector.task import Task
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.task import Task
|
from linspector.task import Task
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.task import Task
|
from linspector.task import Task
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.task import Task
|
from linspector.task import Task
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
"""
|
"""
|
||||||
This file is part of Linspector (https://linspector.org/)
|
This file is part of Linspector (https://linspector.org/)
|
||||||
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
Copyright (c) 2013-2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
See LICENSE (MIT license).
|
See LICENSE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from linspector.task import Task
|
from linspector.task import Task
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue