Added dynamic loading of tasks and services, refactoring and fixes.

This commit is contained in:
Johannes Findeisen 2022-09-27 07:00:17 +02:00
commit 8d9ec5c73b
18 changed files with 51 additions and 236 deletions

View file

@ -1,11 +1,18 @@
[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 = FritzboxUplink
interval = 60
; notifications separated by ','. no whitespaces allowed
notifications = SMS,Email
; values from main configuration can be overridden for each defined monitor
email_receivers = admin@example.com:fallback@example.com
sms_receivers = +329084320984:+39804932409
tasks = None
; email_receivers separated by ','. no whitespaces allowed
email_receivers = admin@example.com,fallback@example.com
; sms_receivers separated by ','. no whitespaces allowed
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
; fixed. setting it like below works but is no good design for optional options. same for notifications.
tasks = Redis
host = 192.168.0.1
user = USERNAME
password = PASSWORD

View file

@ -2,11 +2,10 @@
identifier = dsl
service = FritzboxUplink
interval = 60
# default delimiters '=' and ':' should be changed to ',' to be more native
notifications = SMS,Email
email_receivers = admin@example.com:fallback@example.com
sms_receivers = +329084320984:+39804932409
tasks = MariaDB:Logger:Redis
email_receivers = admin@example.com,fallback@example.com
sms_receivers = +329084320984,+39804932409
tasks = MariaDB
host = 192.168.1.1
user = USERNAME
password = PASSWORD