Lot of bug fixing, optimizations and refactoring.

This commit is contained in:
Johannes Findeisen 2022-10-01 04:37:35 +02:00
commit 549510c3a4
19 changed files with 145 additions and 91 deletions

View file

@ -2,9 +2,9 @@
[linspector]
; report core errors to the following users
error_receivers = admin@example.com
log_file = ~/code/linspector/log/linspector.log
log_file = ~/code/linspector/linspector/log/linspector.log
; available log levels are: "error", "warning", "info" and "debug".
log_level= debug
log_level= info
log_count = 5
log_size = 10485760
pid_file = /var/run/user/1000/linspector.pid
@ -24,8 +24,14 @@ members = superadmin@example.com,developers@example.com
; scheduler configuration
start_scheduler = true
max_threads = 3500
; i recommend to set this to your number of cpu cores available when running on a dedicated linspector host. but if the
; system is running other services you should lower this value when you have too high cpu load.
max_processes = 24
timezone = CET
; this is for scheduling jobs to not run all at the same time. this should be set to the lowest interval you use. it
; can be set to a lower value if you only have a small amount of services you are monitoring. i recommend the lowest
; interval you use any any monitor. it is always starting with 0. default is 60.
delta_range = 10
; hostgroup parents; if the hostgroup "group1" is down, don't alert for the hosts in group2. see TODO.txt for more
; information.

View file

View file

@ -1,10 +1,15 @@
; required options:
[monitor]
; currently i get errors when the service option is not spelled correct. error handling need to fix this. same for
; notifications and tasks.
service = net.FritzboxUplink
service = net.fritzboxuplink
hosts = 192.168.0.1,192.168.23.24,@group1,@testgroup1
interval = 60
; optional options when using notifications, plugins, services or tasks:
[args]
; 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
; email_receivers separated by ','. no whitespaces allowed
email_receivers = admin@example.com,fallback@example.com
@ -18,18 +23,10 @@ tasks = redis
; so we don't need to add a monitor for each host... but it would be a good idea to expose these to hostgroups
; internally to single hosts to become a monitor for each host internally. some more ideas are in ;)
; hosts with added hostgroup defined in main configuration file
hosts = 192.168.0.1,192.168.23.24,@group1,@testgroup1
; monitors can add their self into a hostgroup
hostgroup = group1
hostgroups = group1
user = USERNAME
password = PASSWORD
info = Cable Provider
; only alert when the error reaches the threshold
threshold = 3
; need to think about it but since Linspector does not know variables defined by a service, notification or task they
; need to be handed over as **kwargs dict. so i think it would be a good idea to put them here and just give over all
; these vars as a dict. for now only interval and service are know and even required arguments to get a service running.
[args]
foo = bar
bar = foo

View file

@ -2,15 +2,14 @@
identifier = dsl
service = Net.FritzboxUplink
interval = 60
notifications = Email
email_receivers = admin@example.com,fallback@example.com
sms_receivers = ++number1,+number2
tasks = MariaDB,FileLogger
hosts = 192.168.1.1
[args]
notifications = email
email_receivers = admin@example.com,fallback@example.com
sms_receivers = +number1,+number2
tasks = mariadb,filelogger
user = USERNAME
password = PASSWORD
info = Cable Provider
[args]
foo = bary
bar = fooy
hostgroups = group1

View file

@ -1,7 +1,11 @@
; requireed options
[monitor]
service = misc.dummy
hosts = 192.168.10.10
interval = 60
; optional options
[args]
foo = barx
bar = foox
; the start is to schedule the execution of the monitor in at a date in the future. this is helpful to configure
; linspector before a host is up and running.
start_date = 2025-01-01 00:00:00

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 60
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 60
interval = 10
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 120
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 50
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
service = net.FritzboxUplink
interval = 62
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 30
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 60
interval = 20
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 60
interval = 15
hosts = 192.168.10.10
[args]

View file

@ -1,3 +1,6 @@
[monitor]
service = misc.dummy
interval = 240
hosts = 192.168.10.10
[args]