How to use it
First you need to install Epazote, either you can compile it from source or download a pre-compiled binary matching your operating system from here: https://bintray.com/nbari/epazote/epazote/_latestVersion
To compile from source, after downloading the sources use
make to build the
~/projects/go/src/github.com/epazote/epazote $ make
Epazote was designed with simplicity in mind, as an easy tool for DevOps and as a complement to infrastructure orchestration tools like Ansible and SaltStack, because of this YAML is used for the configuration files, avoiding with this, the learn of a new language or syntax and simplifying the setup.
services: google: url: https://www.google.com seconds: 5 expect: status: 302 ssl: hours: 72 if_not: cmd: echo -n "google down"
$ epazote -f /path/to/yaml/file/basic.yml -d
-d is for debugging, will print all output to standard output.
This example, will supervise every 5 seconds the service with name
http://www.google.com and will expect
302 Status code if not, it will
echo -n "google down"
ssl: hours: 72 means to send an alert if the certificate is about to
expire in the next 72 hours.
Extending the basic example for receiving notifications:
config: smtp: username: [email protected] password: password server: mail.example.com port: 587 headers: from: [email protected] to: [email protected] subject: "[_name_, _because_]" services: google: url: http://www.google.com minutes: 3 threshold: healthy: 2 # consecutive successes unhealthy: 2 # consecutive failures expect: status: 200 if_not: cmd: echo -n "google down" notify: yes
In this case, every 3 minutes the service will be checked and in case of not
200 Status code more than 2 times:
threshold: unhealthy: 2
Besides executing the command:
echo -n "google down" an email is going to be
[email protected], this because of the
notify: yes setting.
After getting 2 consecutive successful responses
200 status code, an alert
is also sent.
The configuration file
The configuration file (YAML formated) consists of two parts, a config and a services (Key-value pairs).