diff --git a/maintenance_service_http_monitoring/README.rst b/maintenance_service_http_monitoring/README.rst deleted file mode 100644 index 98d5171..0000000 --- a/maintenance_service_http_monitoring/README.rst +++ /dev/null @@ -1,58 +0,0 @@ -====================================== -maintenance_service_http_monitoring -====================================== - -Module that allows monitoring of different services by checking their HTTP 200 responses: - -- Uses the `maintenance_server_data` service for each device. - -If the service has a URL, a request is made. -- Adds maintenance mode for a device: - -- Allows disabling HTTP checks for a specified time (defined in the cron job). - -## Logic: -If a request fails and a maintenance task has already been created for the same day, -no new task is added. - -The default values ​​for the cron jobs are located in `data/cron.xml`. - - -Installation -============ - -Use Odoo normal module installation procedure to install -``maintenance_service_http_monitoring``. - -Known issues / Roadmap -====================== - -None yet. - -Bug Tracker -=========== - -Bugs are tracked on `our issues website `_. In case of -trouble, please check there if your issue has already been -reported. If you spotted it first, help us smashing it by providing a -detailed and welcomed feedback. - -Credits -======= - -Contributors ------------- - -* Boris Gallet - -Funders -------- - -The development of this module has been financially supported by: -* Elabore (https://elabore.coop) - - -Maintainer ----------- - -This module is maintained by Elabore. diff --git a/maintenance_service_http_monitoring/__manifest__.py b/maintenance_service_http_monitoring/__manifest__.py index 33fe667..9287423 100644 --- a/maintenance_service_http_monitoring/__manifest__.py +++ b/maintenance_service_http_monitoring/__manifest__.py @@ -1,6 +1,6 @@ { "name": "maintenance_service_http_monitoring", - "version": "16.0.1.0.0", + "version": "18.0.1.0.0", "author": "Elabore", "license": "AGPL-3", "category": "Tools", diff --git a/maintenance_service_http_monitoring/data/cron.xml b/maintenance_service_http_monitoring/data/cron.xml index 3942a7b..08286ef 100644 --- a/maintenance_service_http_monitoring/data/cron.xml +++ b/maintenance_service_http_monitoring/data/cron.xml @@ -7,8 +7,6 @@ model.cron_check_http_services() 15 minutes - -1 - False model.cron_deactivate_expired_maintenance_mode() 15 minutes - -1 - False diff --git a/maintenance_service_http_monitoring/models/service_instance.py b/maintenance_service_http_monitoring/models/service_instance.py index f629e1b..3024801 100644 --- a/maintenance_service_http_monitoring/models/service_instance.py +++ b/maintenance_service_http_monitoring/models/service_instance.py @@ -42,7 +42,7 @@ class ServiceInstance(models.Model): now = fields.Datetime.now() url = rec.service_url if not url.lower().startswith("https://"): - url = "https://" + url.lstrip("http://") + url = "https://" + url.removeprefix("http://").removeprefix("HTTP://") try: response = requests.get(url, timeout=HTTP_CHECK_TIMEOUT) status_code = response.status_code diff --git a/maintenance_service_http_monitoring/views/maintenance_equipment_views.xml b/maintenance_service_http_monitoring/views/maintenance_equipment_views.xml index 07ed61d..9031d62 100644 --- a/maintenance_service_http_monitoring/views/maintenance_equipment_views.xml +++ b/maintenance_service_http_monitoring/views/maintenance_equipment_views.xml @@ -9,7 +9,7 @@