This project is a http API to abstract healthcheck operations, like verify if a web application is working fine and notify to some users if some of this applications are in trouble.
API_URL
- the api base urlAPI_DEBUG
- enables the debug modeZABBIX_URL
- the zabbix api endpointZABBIX_USER
- zabbix userZABBIX_PASSWORD
- zabbix passwordZABBIX_HOST_GROUP
- host group used to create the web monitoringZABBIX_HOST
- host used to create the web monitoringMONGODB_DATABASE
- default is hcapiMONGODB_URI
- mongodb full address$ git clone git@github.com:zabbix/zabbix-docker.git
$ cd zabbix-docker
$ docker-compose -f docker-compose_v3_alpine_mysql_latest.yaml up -d
$ git clone git@github.com:tsuru/healthcheck-as-a-service.git
$ cd healthcheck-as-a-service
$ tsuru app-create hcaas python
$ tsuru env-set -a hcaas API_DEBUG=true ZABBIX_URL=$ZABBIX_URL MONGODB_URI=$MONGODB_URI
$ tsuru app-deploy -a hcaas .
$ export API_URL=$(tsuru app-info -a hcaas | grep Address: |awk '{print $2}')
$ tsuru plugin-install hc <API-URL>/plugin
edit service.yaml
endpoint:production
with hcaas address
$ tsuru service create service.yaml
$ tsuru service-instance-add <healthcheck-service> <healthcheck-name>
$ tsuru service-instance-remove <healthcheck-service> <healthcheck-name>
$ tsuru hc add-url <healthcheck-service> <healthcheck-name> <url> [expected string]
$ tsuru hc remove-url <healthcheck-name> <url>
$ tsuru hc add-watcher <healthcheck-service> <healthcheck-name> <email>
$ tsuru hc remove-watcher <healthcheck-name> <email>
$ tsuru hc list-service-groups <healthcheck-service> [search-keyword]
$ tsuru hc add-group <healthcheck-service> <healthcheck-name> <hostgroup-name>
$ tsuru hc-remove-group <healthcheck-service> <healthcheck-name> <hostgroup-name>
$ tsuru hc list-groups <healthcheck-service> <healthcheck-name>
Pull requests are very welcomed! Make sure your patches are well tested.
If you are using a virtualenv, all you need is:
$ make test