Cleanups and README update.

This commit is contained in:
Johannes Findeisen 2022-09-26 23:37:40 +02:00
commit 7d5e372410
5 changed files with 24 additions and 20 deletions

View file

@ -8,15 +8,17 @@ complicated. The idea still remains so here is the rebirth of Linspector. First
of this rewrite where done as a new project named of this rewrite where done as a new project named
[monipy](https://git.unixpeople.org/linspector/monipy), but I moved to the name [monipy](https://git.unixpeople.org/linspector/monipy), but I moved to the name
Linspector because I believe it is the better and cooler name... Old Linspector code is Linspector because I believe it is the better and cooler name... Old Linspector code is
not available in any repository anymore, but I have archived it on my local disc. not available in this repository anymore, you can find it under
[https://git.unixpeople.org/linspector/linspector-old]().
Hope this project it will become useful for someone at some day and not only for Hope this project will become useful for someone at some day and not only for
me. Just give me some amount of time for the first usable release... ;) me. Just give me some amount of time for the first usable release... ;)
## About ## About
**Linspector** contains some tools and a daemon to monitor your infrastructure. It **Linspector** contains a daemon and some tools to monitor your infrastructure. It
collects data for statistics and sends alerts in case of errors. collects data for statistics and sends alerts in case of errors. When extending Linspector
with plugins it for example can provide a web interface etc.
This project is at a very early stage of development it is not able for usage. This project is at a very early stage of development it is not able for usage.
I design the software actually and try to convert my ideas to software. Code I design the software actually and try to convert my ideas to software. Code
@ -61,6 +63,13 @@ According to: [https://wiki.unixpeople.org/linux_kernel_version_numbering](https
not affect the documentation and _must_ not break the API. not affect the documentation and _must_ not break the API.
- **FIXES** _must_ never affect anything else then stability or security. - **FIXES** _must_ never affect anything else then stability or security.
### Configuration file rules
- No inline comments so every available character can be used in values
- Values can be overridden in each monitor
- File names in etc/* are not important but section names and key names.
- Comments can be inserted using ';' or '#'
## License ## License
### MIT License ### MIT License

View file

@ -1,9 +1,4 @@
; all you need to know: https://docs.python.org/3/library/configparser.html ... ;) ; all you need to know: https://docs.python.org/3/library/configparser.html ... ;)
; manifest:
; - no inline comments so every available character can be used in values
; - values can be overridden in each monitor
; - file names are not important but section names and key names.
; - comments can be inserted using ',' or '#'
[linspector] [linspector]
; report core errors to the following users ; report core errors to the following users
error_receivers = admin@example.com error_receivers = admin@example.com
@ -13,8 +8,8 @@ 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
; default delimiters '=' and ':' should be changed to ',' to be more native ; default delimiters '=' and ':' should be changed to ',' to be more native
plugins = backend.HTTPServer plugins = HTTPServer
tasks = database.MariaDB:storage.Logger tasks = MariaDB:Logger
; 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
@ -23,8 +18,8 @@ run_mode = cron
; is needed. see email example. ; 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 = +34324234234:+324242344 sms_receivers = +number1:+number2
sms_configuration_file = ~/code/linspector/etc/gammurc sms_configuration_file = ~/linspector/etc/gammurc
; retry to send interval and number of retries if something failed ; retry to send interval and number of retries if something failed
sms_resend = 10 sms_resend = 10
sms_resend_count = 5 sms_resend_count = 5
@ -43,6 +38,6 @@ speedtest_url = https://go.microsoft.com/fwlink/?Linkid=850641
[tasks] [tasks]
mariadb_database = linspector mariadb_database = linspector
mariadb_host = 10.0.0.254 mariadb_host = 10.0.0.254
mariadb_password = 3qx7HfrxGNM83lqN mariadb_password = PASSWORD
mariadb_port": 3306 mariadb_port": 3306
mariadb_user = uplink mariadb_user = USER

View file

@ -2,6 +2,6 @@
resend = 20 resend = 20
smtp_host = mail.example.com smtp_host = mail.example.com
smtp_port = 25 smtp_port = 25
smtp_password = k4509knsd09 smtp_password = PASSWORD
smtp_user = alert@hanez.org smtp_user = alerts@example.com
receivers = admin@example.com receivers = admin@example.com

View file

@ -84,9 +84,9 @@ class Configuration:
else: else:
return None return None
# this function can be called by notifications, plugins and types to set a default value if not # this function can be called by notifications, plugins etc. to set their default values if not
# configured. since all objects have access to the configuration this should not be done from # configured. since all objects have access to the configuration this should not be done from
# any other place because it can break monipy. # any other place because it can break linspector.
# maybe it can be used for dynamic runtime configuration later but need to think about it. # maybe it can be used for dynamic runtime configuration later but need to think about it.
def set_option(self, section, option, value): def set_option(self, section, option, value):
if not self.__configuration.has_option(section, option): if not self.__configuration.has_option(section, option):

View file

@ -29,7 +29,7 @@ logger = getLogger('linspector')
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
stability of monipy. stability or runtime of Linspector.
""" """
def __init__(self, configuration): def __init__(self, configuration):
self.__configuration = configuration self.__configuration = configuration