You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.7 KiB

10 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
  1. # healthchecks
  2. [![Build Status](https://travis-ci.org/healthchecks/healthchecks.svg?branch=master)](https://travis-ci.org/healthchecks/healthchecks)
  3. [![Coverage Status](https://coveralls.io/repos/healthchecks/healthchecks/badge.svg?branch=master&service=github)](https://coveralls.io/github/healthchecks/healthchecks?branch=master)
  4. ![Screenshot of Welcome page](/stuff/screenshots/welcome.png?raw=true "Welcome Page")
  5. ![Screenshot of My Checks page](/stuff/screenshots/my_checks.png?raw=true "My Checks Page")
  6. ![Screenshot of Period/Grace dialog](/stuff/screenshots/period_grace.png?raw=true "Period/Grace Dialog")
  7. ![Screenshot of Channels page](/stuff/screenshots/channels.png?raw=true "Channels Page")
  8. healthchecks is a watchdog for your cron jobs. It's a web server that listens for pings from your cron jobs, plus a web interface.
  9. It is live here: [http://healthchecks.io/](http://healthchecks.io/)
  10. The building blocks are:
  11. * Python 2 or Python 3
  12. * Django 1.9
  13. * PostgreSQL or MySQL
  14. ## Setting Up for Development
  15. These are instructions for setting up HealthChecks Django app
  16. in development environment.
  17. * prepare directory for project code and virtualenv:
  18. $ mkdir -p ~/webapps
  19. $ cd ~/webapps
  20. * prepare virtual environment
  21. (with virtualenv you get pip, we'll use it soon to install requirements):
  22. $ virtualenv --python=python3 hc-venv
  23. $ source hc-venv/bin/activate
  24. * check out project code:
  25. $ git clone https://github.com/healthchecks/healthchecks.git
  26. * install requirements (Django, ...) into virtualenv:
  27. $ pip install -r healthchecks/requirements.txt
  28. * make sure PostgreSQL server is installed and running, create
  29. database "hc":
  30. $ psql --user postgres
  31. postgres=# create database hc;
  32. * create database tables, triggers, superuser:
  33. $ cd ~/webapps/healthchecks
  34. $ ./manage.py migrate
  35. $ ./manage.py ensuretriggers
  36. $ ./manage.py createsuperuser
  37. * run development server:
  38. $ ./manage.py runserver
  39. ## Sending Emails
  40. healthchecks must be able to send email messages, so it can send out login
  41. links and alerts to users. You will likely need to tweak email configuration
  42. before emails will work. healthchecks uses
  43. [djmail](http://bameda.github.io/djmail/) for sending emails asynchronously.
  44. Djmail is a BSD Licensed, simple and nonobstructive django email middleware.
  45. It can be configured to use any regular Django email backend behind the
  46. scenes. For example, the healthchecks.io site uses
  47. [django-ses-backend](https://github.com/piotrbulinski/django-ses-backend/)
  48. and the email configuration in `hc/local_settings.py` looks as follows:
  49. DJMAIL_REAL_BACKEND = 'django_ses_backend.SESBackend'
  50. AWS_SES_ACCESS_KEY_ID = "put-access-key-here"
  51. AWS_SES_SECRET_ACCESS_KEY = "put-secret-access-key-here"
  52. AWS_SES_REGION_NAME = 'us-east-1'
  53. AWS_SES_REGION_ENDPOINT = 'email.us-east-1.amazonaws.com'
  54. ## Sending Status Notifications
  55. healtchecks comes with a `sendalerts` management command, which continuously
  56. polls database for any checks changing state, and sends out notifications as
  57. needed. Within an activated virtualenv, you can manually run
  58. the `sendalerts` command like so:
  59. $ ./manage.py sendalerts
  60. In a production setup, you will want to run this command from a process
  61. manager like [supervisor](http://supervisord.org/) or systemd.
  62. ## Integrations
  63. ### Pushover
  64. To enable Pushover integration, you will need to:
  65. * register a new application on https://pushover.net/apps/build
  66. * enable subscriptions in your application and make sure to enable the URL
  67. subscription type
  68. * add the application token and subscription URL to `hc/local_settings.py`, as
  69. `PUSHOVER_API_TOKEN` and `PUSHOVER_SUBSCRIPTION_URL`