Package: django-anexia-monitoring
Anexia MonitoringA Django app used to monitor updates for Django and all installed python
packages in the running environment. It can be also used to check if the
website is alive and working correctly.Django Compatibility MatrixIf your project uses an older version of Django, you can choose an older version of this project.This ProjectPython VersionDjango Version1.5.*3.7 - 3.103.2, 4.0, 4.11.4.*3.7 - 3.103.2, 4.01.3.*3.5 - 3.92.2, 3.1, 3.21.2.*3.5 - 3.82.2, 3.0, 3.11.1.*2.7, 3.4, 3.51.8, 1.11Installation and configurationInstall the package by using pippipinstalldjango-anexia-monitoringAdd the app the settings installed appsINSTALLED_APPS=[...# Anexia monitor'anexia_monitoring',...]In the projects settings.py add the access token configuration:ANX_MONITORING_ACCESS_TOKEN='custom_access_token'Add URL configuration for REST endpointfromanexia_monitoringimporturlsasmonitor_urls...urlpatterns=[...# Anexia monitoringre_path(r'^',include(monitor_urls)),...]UsageThe plugin registers some custom REST endpoints which can be used for
monitoring. Make sure that theANX_MONITORING_ACCESS_TOKENis
defined, since this is used for authorization. The endpoints will return
a 401 HTTP_STATUS code if the token is not define or invalid, and a 200
status code otherwise.Version monitoringReturns all a list with platform and module information.URL:/anxapi/v1/modules/?access_token=custom_access_tokenResponse headers:Status Code: 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Allow: GET
Content-Type: application/jsonResponse body:{"platform":{"platform":"python","framework_installed_version":"1.11.1","framework_newest_version":"2.0a1","framework":"django","platform_version":"3.5.3 (default, Apr 26 2017, 20:12:19) \n[GCC 4.9.2]"},"modules":[{"newest_version":"1.4.3","newest_version_licences":["MIT"],"name":"appdirs","installed_version":"1.4.3","installed_version_licences":["MIT"]},{"newest_version":"0.22.0","newest_version_licences":["MIT"],"name":"asn1crypto","installed_version":"0.22.0","installed_version_licences":["MIT"],},{"newest_version":"2.4.0","newest_version_licences":["BSD"],"name":"Babel","installed_version":"2.4.0","installed_version_licences":["BSD"],}]}Live monitoringThis endpoint can be used to verify if the application is alive and
working correctly. It checks if the database connection is working and
makes a query for users. It allows to register custom checks by using
the dispatchedmonitor_up_checkevent.URL:/anxapi/v1/up/?access_token=custom_access_tokenResponse headers:Status Code: 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Allow: GET
Content-Type: text/plainResponse body:OKCustom live monitoring eventThis check can be defined into the app even subscribersfromdjango.dispatchimportreceiverfromanexia_monitoring.eventsimportmonitor_up_check@receiver(monitor_up_check)deflist_of_complete_polls_handler(sender,**kwargs):"""My custom is alive check"""passLive monitoring settingsThe User table is used in most Django applications and by default theupendpoint will make a test query to this
table. If you don't need it you can disable it using theANX_MONITORING_TEST_QUERY_USERSsetting.Similar most Django applications also use a database connection which the module tests for connection by default.
If you don't need this you can deactivate it by providing theANX_MONITORING_TEST_DB_CONNECTIONSsetting.ANX_MONITORING_TEST_QUERY_USERS=FalseANX_MONITORING_TEST_DB_CONNECTIONS=FalseList of developersHarald Nezbeda, Lead developerProject related external resourcesDjango documentation