Fixed bug 0001 and added username to vendor.avm.is_connected service. (0.26.1)

This commit is contained in:
Johannes Findeisen 2023-08-31 22:58:37 +02:00
commit 971ec6329f
4 changed files with 10 additions and 4 deletions

View file

@ -20,7 +20,7 @@ from linspector.environment import Environment
from linspector.linspector import Linspector
from linspector.monitors import Monitors
__version__ = '0.26.0'
__version__ = '0.26.1'
__author__ = 'Johannes Findeisen <you@hanez.org>'

View file

@ -1,3 +1,7 @@
# This error is fixed by replacing "'" with "" in the error message of FritzStatus
# in the vendor.avm.is_connected service. It breaks the SQL statement when there
# is a "'" in the generated SQL string.
[2023-08-29 14:55:06.350038 +0200] [0:46:32.576412] [INFO] [linspector]: identifier=remote1.port25 host=a.xw3.org service=net.port status=OK
[2023-08-29 14:55:13.571002 +0200] [0:46:39.797376] [INFO] [linspector]: identifier=remote1.port995 host=a.xw3.org service=net.port status=OK
[2023-08-29 14:55:14.394669 +0200] [0:46:40.621043] [INFO] [linspector]: identifier=remote1.port110 host=a.xw3.org service=net.port status=OK

View file

@ -28,7 +28,7 @@ class PortService(Service):
error = str(err)
status = 'ERROR'
return {'error': error,
return {'error': error.replace('\'', ''),
'host': monitor.get_host(),
'log': self.get_str(identifier, monitor.get_host(), service, status),
'service': service,

View file

@ -19,7 +19,9 @@ class IsConnectedService(Service):
try:
fc = FritzStatus(address=monitor.get_host(),
password=kwargs['password'])
user=kwargs['user'],
password=kwargs['password'],
timeout=10)
error = 'None'
if fc.is_connected:
status = 'OK'
@ -29,7 +31,7 @@ class IsConnectedService(Service):
error = str(err)
status = 'ERROR'
result = {'error': error,
result = {'error': error.replace('\'', ''),
'host': monitor.get_host(),
'log': self.get_str(identifier, monitor.get_host(), service, status),
'service': service,