Lot of new ideas defined in configuration files and tons of refactoring.
This commit is contained in:
parent
947a14bdde
commit
3de67966f4
49 changed files with 307 additions and 76 deletions
4
AUTHORS
4
AUTHORS
|
|
@ -1,6 +1,6 @@
|
||||||
* Findeisen, Johannes
|
* Findeisen, Johannes
|
||||||
Founder, core developer and maintainer.
|
Role: Founder, developer and maintainer
|
||||||
Email: you@hanez.org
|
Email: you@hanez.org
|
||||||
Homepage: http://hanez.org/
|
Homepage: https://hanez.org/
|
||||||
Git: https://git.unixpeople.org/hanez
|
Git: https://git.unixpeople.org/hanez
|
||||||
GitHub: https://github.com/hanez/>
|
GitHub: https://github.com/hanez/>
|
||||||
|
|
|
||||||
0
etc/hostgroups/.gitkeep
Normal file
0
etc/hostgroups/.gitkeep
Normal file
2
etc/hostgroups/testgroup1.conf
Normal file
2
etc/hostgroups/testgroup1.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[hostgroups]
|
||||||
|
testgroup1 = host1,host2,host3,192.168.2.1>192.168.2.127
|
||||||
|
|
@ -7,20 +7,38 @@ log_level= verbose
|
||||||
log_count = 5
|
log_count = 5
|
||||||
log_size = 10485760
|
log_size = 10485760
|
||||||
pid_file = /var/run/user/1000/linspector.pid
|
pid_file = /var/run/user/1000/linspector.pid
|
||||||
; plugins separated by ','. no whitespaces allowed
|
; plugins separated by ','. no whitespaces allowed. not case sensitive.
|
||||||
plugins = lish,httpserver
|
plugins = Lish,HTTPServer
|
||||||
; globally configured tasks will always run on all monitors when no task is configured there. if tasks are configured in
|
; globally configured tasks will always run on all monitors when no task is configured there. if tasks are configured in
|
||||||
; a monitor then maybe only run tasks from the dedicated monitor. maybe it is a good idea to run global tasks in every
|
; a monitor then maybe only run tasks from the dedicated monitor. maybe it is a good idea to run global tasks in every
|
||||||
; monitor and the monitor can add tasks to the global settings... need to think about it.
|
; monitor and the monitor can add tasks to the global settings... need to think about it.
|
||||||
; tasks separated by ','. no whitespaces allowed
|
; tasks separated by ','. no whitespaces allowed
|
||||||
tasks = sqlite
|
tasks = SQLite
|
||||||
notification = SMS
|
notification = SMS
|
||||||
; maybe the run_mode is obsolete because this will be a daemon but maybe it is useful for one time execution?
|
; maybe the run_mode is obsolete because this will be a daemon but maybe it is useful for one time execution?
|
||||||
; in uplink the available run_modes were cron, daemon and foreground
|
; in uplink the available run_modes were cron, daemon and foreground
|
||||||
run_mode = cron
|
run_mode = cron
|
||||||
|
|
||||||
; every notification can be configured in it's own ini file in etc/notifications; there no notification name as prefix
|
; a flexible way to define groups of hosts which can be used by monitors as target for monitoring for easily monitor
|
||||||
; is needed. see email example.
|
; groups without adding a monitor for each host. for some more information see the "hosts" section in gateway.conf.
|
||||||
|
; hostgroups can be defined in separate files in etc/hostgroups to be more flexible.
|
||||||
|
[hostgroups]
|
||||||
|
; add single hosts
|
||||||
|
group1 = host1,host2,host3
|
||||||
|
; add a range of ip addresses. maybe a different range operator should be chosen but for now i think ">" is sexy... :)
|
||||||
|
group2 = 192.168.1.1>192.168.1.127
|
||||||
|
; add a combination of hosts and ranges
|
||||||
|
group3 = host1,host2,host3,192.168.1.1>192.168.1.127
|
||||||
|
|
||||||
|
; just an idea taken from the old Linspector design. not tried but seems a good idea to add global options to monitor
|
||||||
|
; groups. no idea of an implementation yet.
|
||||||
|
[monitorgroups]
|
||||||
|
; members of monitors to automatically send notifications to all without need to set them in each monitor. members can
|
||||||
|
; be added to monitors in the configuration of each monitor though.
|
||||||
|
network1_members = admin1@example.com,admin2@example.com,admin3@example.com
|
||||||
|
|
||||||
|
; every notification can be configured in it's own configuration file in etc/notifications; there no notification
|
||||||
|
; name as prefix is needed. see email example.
|
||||||
[notifications]
|
[notifications]
|
||||||
; values can be overridden in each defined monitor
|
; values can be overridden in each defined monitor
|
||||||
sms_receivers = +number1,+number2
|
sms_receivers = +number1,+number2
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
[monitor]
|
[monitor]
|
||||||
; currently i get errors when the service option is not spelled correct. error handling need to fix this. same for
|
; currently i get errors when the service option is not spelled correct. error handling need to fix this. same for
|
||||||
; notifications and tasks.
|
; notifications and tasks.
|
||||||
service = fritzboxuplink
|
service = net.FritzboxUplink
|
||||||
interval = 60
|
interval = 60
|
||||||
; notifications separated by ','. no whitespaces allowed. the case is not important.
|
; notifications separated by ','. no whitespaces allowed. the case is not important.
|
||||||
notifications = sMs,Email
|
notifications = sMs,EmaiL
|
||||||
; values from main configuration can be overridden for each defined monitor
|
; values from main configuration can be overridden for each defined monitor
|
||||||
; email_receivers separated by ','. no whitespaces allowed
|
; email_receivers separated by ','. no whitespaces allowed
|
||||||
email_receivers = admin@example.com,fallback@example.com
|
email_receivers = admin@example.com,fallback@example.com
|
||||||
|
|
@ -13,11 +13,12 @@ sms_receivers = +329084320984,+39804932409
|
||||||
; setting to None fails. just do not set this option. currently i get an error when tasks is not set here. need to be
|
; setting to None fails. just do not set this option. currently i get an error when tasks is not set here. need to be
|
||||||
; fixed. setting it like below works but is no good design for optional options. same for notifications.
|
; fixed. setting it like below works but is no good design for optional options. same for notifications.
|
||||||
tasks = redis
|
tasks = redis
|
||||||
; maybe this should be some kind of range too, for example for the ping service like: 10.0.0.1-10.0.0.42 or more
|
; maybe this should be some kind of range too, for example for the ping service like: 10.0.0.1>10.0.0.42 or more
|
||||||
; sophisticated kind of ranges... i will find a solution for that... like host groups in the old version of Linspector
|
; sophisticated kind of ranges... i will find a solution for that... like host groups in the old version of Linspector
|
||||||
; so we don't need to add a monitor for each host... but it would be a good idea to expose these hosts to become a
|
; so we don't need to add a monitor for each host... but it would be a good idea to expose these to hostgroups
|
||||||
; monitor for each host internally. ;)
|
; internally to single hosts to become a monitor for each host internally. some more ideas are in ;)
|
||||||
host = 192.168.0.1
|
; hosts with added hostgroup defined in main configuration file
|
||||||
|
hosts = 192.168.0.1,192.168.23.24,@group1,@testgroup1
|
||||||
user = USERNAME
|
user = USERNAME
|
||||||
password = PASSWORD
|
password = PASSWORD
|
||||||
info = Cable Provider
|
info = Cable Provider
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
[monitor]
|
[monitor]
|
||||||
identifier = dsl
|
identifier = dsl
|
||||||
service = FritzboxUplink
|
service = Net.FritzboxUplink
|
||||||
interval = 60
|
interval = 60
|
||||||
notifications = Email
|
notifications = Email
|
||||||
email_receivers = admin@example.com,fallback@example.com
|
email_receivers = admin@example.com,fallback@example.com
|
||||||
sms_receivers = +329084320984,+39804932409
|
sms_receivers = +329084320984,+39804932409
|
||||||
tasks = MariaDB,FileLogger
|
tasks = MariaDB,FileLogger
|
||||||
host = 192.168.1.1
|
hosts = 192.168.1.1
|
||||||
user = USERNAME
|
user = USERNAME
|
||||||
password = PASSWORD
|
password = PASSWORD
|
||||||
info = Cable Provider
|
info = Cable Provider
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
this file should not raise an error because it does has the .conf suffix. only .conf files should be processed.
|
||||||
2
etc/monitors/test/test1.conf
Normal file
2
etc/monitors/test/test1.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[monitor]
|
||||||
|
service = misc.dummy
|
||||||
|
|
@ -20,7 +20,6 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import atexit
|
import atexit
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from linspector.core.daemon import Daemon
|
from linspector.core.daemon import Daemon
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
|
||||||
|
|
@ -20,15 +20,15 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
# 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.
|
||||||
class Model:
|
class Model:
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
super().__init__()
|
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self._environment = environment
|
self._environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
|
||||||
33
linspector/core/notification.py
Normal file
33
linspector/core/notification.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
"""
|
||||||
|
This file is part of Linspector (https://linspector.org/)
|
||||||
|
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
class Notification:
|
||||||
|
|
||||||
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__()
|
||||||
|
self.__configuration = configuration
|
||||||
|
self._environment = environment
|
||||||
33
linspector/core/plugin.py
Normal file
33
linspector/core/plugin.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
"""
|
||||||
|
This file is part of Linspector (https://linspector.org/)
|
||||||
|
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
class Plugin:
|
||||||
|
|
||||||
|
def __init__(self, configuration, environment, linspector):
|
||||||
|
self.__configuration = configuration
|
||||||
|
self._environment = environment
|
||||||
|
self.__linspector = linspector
|
||||||
33
linspector/core/service.py
Normal file
33
linspector/core/service.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
"""
|
||||||
|
This file is part of Linspector (https://linspector.org/)
|
||||||
|
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
class Service:
|
||||||
|
|
||||||
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__()
|
||||||
|
self.__configuration = configuration
|
||||||
|
self._environment = environment
|
||||||
32
linspector/core/task.py
Normal file
32
linspector/core/task.py
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
"""
|
||||||
|
This file is part of Linspector (https://linspector.org/)
|
||||||
|
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
class Task:
|
||||||
|
|
||||||
|
def __init__(self, configuration, environment):
|
||||||
|
self.__configuration = configuration
|
||||||
|
self._environment = environment
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.notification import Notification
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,8 +31,9 @@ def get(configuration, environment):
|
||||||
return CallNotification(configuration, environment)
|
return CallNotification(configuration, environment)
|
||||||
|
|
||||||
|
|
||||||
class CallNotification:
|
class CallNotification(Notification):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.notification import Notification
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,8 +31,9 @@ def get(configuration, environment):
|
||||||
return EmailNotification(configuration, environment)
|
return EmailNotification(configuration, environment)
|
||||||
|
|
||||||
|
|
||||||
class EmailNotification:
|
class EmailNotification(Notification):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.notification import Notification
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,8 +31,9 @@ def get(configuration, environment):
|
||||||
return SMSNotification(configuration, environment)
|
return SMSNotification(configuration, environment)
|
||||||
|
|
||||||
|
|
||||||
class SMSNotification:
|
class SMSNotification(Notification):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.notification import Notification
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,8 +31,9 @@ def get(configuration, environment):
|
||||||
return TwitterNotification(configuration, environment)
|
return TwitterNotification(configuration, environment)
|
||||||
|
|
||||||
|
|
||||||
class TwitterNotification:
|
class TwitterNotification(Notification):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.notification import Notification
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,8 +31,9 @@ def get(configuration, environment):
|
||||||
return XMPPNotification(configuration, environment)
|
return XMPPNotification(configuration, environment)
|
||||||
|
|
||||||
|
|
||||||
class XMPPNotification:
|
class XMPPNotification(Notification):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,13 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import cherrypy
|
import cherrypy
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.plugin import Plugin
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -34,9 +35,10 @@ def get(configuration, environment, linspector):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class HTTPServerPlugin:
|
class HTTPServerPlugin(Plugin):
|
||||||
|
|
||||||
def __init__(self, configuration, environment, linspector):
|
def __init__(self, configuration, environment, linspector):
|
||||||
|
super().__init__(configuration, environment, linspector)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
self.__linspector = linspector
|
self.__linspector = linspector
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.plugin import Plugin
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,9 +32,10 @@ def get(configuration, environment, linspector):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class LishPlugin:
|
class LishPlugin(Plugin):
|
||||||
|
|
||||||
def __init__(self, configuration, environment, linspector):
|
def __init__(self, configuration, environment, linspector):
|
||||||
|
super().__init__(configuration, environment, linspector)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
self.__linspector = linspector
|
self.__linspector = linspector
|
||||||
|
|
|
||||||
0
linspector/services/http/__init__.py
Normal file
0
linspector/services/http/__init__.py
Normal file
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class HTTPKeywordService:
|
class HTTPKeywordService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
0
linspector/services/misc/__init__.py
Normal file
0
linspector/services/misc/__init__.py
Normal file
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class DummyService:
|
class DummyService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class RandomService:
|
class RandomService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
0
linspector/services/net/__init__.py
Normal file
0
linspector/services/net/__init__.py
Normal file
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,11 +32,12 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class FritzboxUplinkService:
|
class FritzboxUplinkService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
||||||
def execute(self):
|
#def execute(self):
|
||||||
print(__file__ + ' (37): ' + 'test...')
|
# print(__file__ + ' (37): ' + 'test...')
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class PingService:
|
class PingService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class PortService:
|
class PortService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class ShellService:
|
class ShellService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
@ -20,13 +20,14 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import calendar
|
import calendar
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -35,9 +36,10 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class SpeedtestService:
|
class SpeedtestService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
||||||
|
|
@ -91,6 +93,3 @@ class SpeedtestService:
|
||||||
logger.warning('could not calculate download speed!')
|
logger.warning('could not calculate download speed!')
|
||||||
|
|
||||||
time.sleep(self.__configuration.get_speedtest_interval())
|
time.sleep(self.__configuration.get_speedtest_interval())
|
||||||
|
|
||||||
def write_to_db(self):
|
|
||||||
return
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class SSHService:
|
class SSHService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class TCPConnectService:
|
class TCPConnectService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
0
linspector/services/snmp/__init__.py
Normal file
0
linspector/services/snmp/__init__.py
Normal file
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class SNMPGetService:
|
class SNMPGetService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
0
linspector/services/ssh/__init__.py
Normal file
0
linspector/services/ssh/__init__.py
Normal file
40
linspector/services/ssh/tcpconnect.py
Normal file
40
linspector/services/ssh/tcpconnect.py
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
"""
|
||||||
|
This file is part of Linspector (https://linspector.org/)
|
||||||
|
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
|
||||||
|
|
||||||
|
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.core.service import Service
|
||||||
|
|
||||||
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
def get(configuration, environment):
|
||||||
|
return TCPConnectService(configuration, environment)
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
|
class TCPConnectService(Service):
|
||||||
|
|
||||||
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
|
self.__configuration = configuration
|
||||||
|
self.__environment = environment
|
||||||
0
linspector/services/sys/__init__.py
Normal file
0
linspector/services/sys/__init__.py
Normal file
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.service import Service
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class UptimeService:
|
class UptimeService(Service):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.task import Task
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class FileLoggerTask:
|
class FileLoggerTask(Task):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.task import Task
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class MariaDBTask:
|
class MariaDBTask(Task):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.task import Task
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,9 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class RedisTask:
|
class RedisTask(Task):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ 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
|
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.
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
|
from linspector.core.task import Task
|
||||||
|
|
||||||
logger = getLogger('linspector')
|
logger = getLogger('linspector')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,9 +32,9 @@ def get(configuration, environment):
|
||||||
|
|
||||||
|
|
||||||
# TODO: check for all required configuration options and set defaults if needed.
|
# TODO: check for all required configuration options and set defaults if needed.
|
||||||
class SQLiteTask:
|
class SQLiteTask(Task):
|
||||||
|
|
||||||
def __init__(self, configuration, environment):
|
def __init__(self, configuration, environment):
|
||||||
|
super().__init__(configuration, environment)
|
||||||
self.__configuration = configuration
|
self.__configuration = configuration
|
||||||
self.__environment = environment
|
self.__environment = environment
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue