Reverted a lot to find an error but maybe it is better like this. Maybe subdirs wil become a good idea again but it makes it harder to configure.

This commit is contained in:
Johannes Findeisen 2022-09-25 07:31:48 +02:00
commit 37b08cb565
45 changed files with 46 additions and 8 deletions

View file

@ -46,4 +46,5 @@ speedtest_url = https://go.microsoft.com/fwlink/?Linkid=850641
[services]
foo = bar
[tasks]
[tasks]
bar = foo

View file

@ -3,10 +3,10 @@
; dynamically. identifiers should maybe a checksum of some options so they will not change when small changes to
; the configurations changes and will remain even when doing a fresh install.
identifier = cable
service = net.Fritzbox
service = Fritzbox
interval = 60
# default delimiters '=' and ':' should be changed to ',' to be more native
notifications = phone.SMS:net.Email
notifications = SMS:Email
email_receivers = admin@example.com:fallback@example.com
sms_receivers = +329084320984:+39804932409
host = 192.168.0.1

View file

@ -1,9 +1,9 @@
[main]
identifier = dsl
service = net.Fritzbox
service = Fritzbox
interval = 60
# default delimiters '=' and ':' should be changed to ',' to be more native
notifications = phone.SMS:net.Email
notifications = SMS:Email
email_receivers = admin@example.com:fallback@example.com
sms_receivers = +329084320984:+39804932409
host = 192.168.1.1

View file

@ -47,8 +47,9 @@ class Configuration:
if not self.__configuration.has_section(target_section):
self.__configuration.add_section(target_section)
section_list = glob.glob(configuration_path + '/linspector/' + target_section + '/*')
section_list = glob.glob(configuration_path + '/' + target_section + '/*.ini')
for section_file in section_list:
print("-->"+section_file)
configuration = configparser.ConfigParser()
configuration.read(section_file, 'utf-8')
for source_section in configuration.sections():

View file

@ -0,0 +1,36 @@
"""
This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from logging import getLogger
from linspector.services.service import Service
logger = getLogger('linspector')
# TODO: check for all required configuration options and set defaults if needed.
class HTTPKeywordService(Service):
def __init__(self, configuration, environment):
super().__init__(configuration, environment)
self.__configuration = configuration
self.__environment = environment

View file

@ -28,7 +28,7 @@ logger = getLogger('linspector')
# TODO: check for all required configuration options and set defaults if needed.
class KeywordService(Service):
class SNMPGetService(Service):
def __init__(self, configuration, environment):
super().__init__(configuration, environment)

View file

@ -28,7 +28,7 @@ logger = getLogger('linspector')
# TODO: check for all required configuration options and set defaults if needed.
class GetService(Service):
class TCPConnectService(Service):
def __init__(self, configuration, environment):
super().__init__(configuration, environment)