-
Notifications
You must be signed in to change notification settings - Fork 68
Service Monitoring
Quokka monitors services that have been configured, for availability and response time. The configuration of services is found in the quokka/data/services.yaml file. In here you will see, for every service monitoring instance configured, the following information:
- name: A name for this service instance, of your choosing, each should be unique.
- type: The type of service, e.g. 'https' for HTTP, 'dns' for DNS, and 'ntp' for NTP.
-
target: The specific service that is going to be monitored.
- For HTTP this will be the URL of the web site we are monitoring
- For DNS this will be the DNS server (aka nameserver) that implements the DNS service we are monitoring
- For NTP this will be the NTP server that we are monitoring
- data: Depends on the service, but this is extra data that will be used in the request sent to the target. For example, for DNS, the 'data' will be the hostname for the server to look up.
The mechanism for monitoring services depends on the service being monitored:
- HTTP/S: For HTTP, quokka attempts to access the configured 'target', which is a URL, using the python 'requests' package.
- DNS: For DNS, quokka uses the 'dns.resolver' package, sending a query to the 'target' (a DNS server), resolving the name specified in the 'data' portion of the configuration for this service.
- NTP: For NTP, quokka uses the 'ntplib' package, and requests the time information from the configured 'target'.
For quokka as it exists today, these (HTTP, DNS, NTP_ are the only service types implemented for monitoring. You can add other 'targets' - other services of this type, using the configuration file services.yaml.
Adding the capability to monitor other service types is a straightforward matter of adding code to attempt to access the new service type, figuring out what python package implements access to the service (e.g. I used 'requests' for HTTP, 'dns' for DNS, and 'ntplib' for NTP).