- Specify method to ping with - Body regex match - Markdown in incident messages - Update existing incidents
69 lines
2.7 KiB
Markdown
69 lines
2.7 KiB
Markdown

|
|
|
|
Features
|
|
--------
|
|
|
|
- [x] Creates & Resolves Incidents
|
|
- [x] Posts monitor lag to cachet graphs
|
|
- [x] Updates Component to Partial Outage
|
|
- [x] Updates Component to Major Outage if already in Partial Outage (works well with distributed monitoring)
|
|
- [x] Can be run on multiple servers and geo regions
|
|
|
|
Configuration
|
|
-------------
|
|
|
|
```
|
|
{
|
|
"api_url": "https://<cachet domain>/api/v1",
|
|
"api_token": "<cachet api token>",
|
|
"insecure_api": false, // optional, false default, set if your certificate is self-signed/untrusted
|
|
"monitors": [{
|
|
"name": "Name of your monitor", // required, friendly name for your monitor
|
|
"url": "Ping URL", // required, url to probe
|
|
"method": "get", // optional, http method (defaults GET)
|
|
"strict_tls": true, // self-signed ssl certificate
|
|
"interval": 10, // seconds between checks
|
|
"metric_id": <metric id>, // post lag to cachet metric (graph)
|
|
"component_id": <component id>, // post incidents to this component
|
|
"threshold": 80, // If % of downtime is over this threshold, open an incident
|
|
"expected_status_code": 200, // optional, expected status code (either status code or body must be supplied)
|
|
"expected_body": "P.*NG" // optional, regular expression
|
|
}],
|
|
"system_name": "", // optional, system name to identify bot
|
|
"log_path": "" // optional, defaults to stdout
|
|
}
|
|
```
|
|
|
|
Installation
|
|
------------
|
|
|
|
1. Download binary from release page
|
|
2. Create your configuration ([example](https://raw.githubusercontent.com/CastawayLabs/cachet-monitor/master/example.config.json))
|
|
3. `cachet-monitor -c /etc/cachet-monitor.config.json`
|
|
|
|
tip: run in background using `nohup cachet-monitor 2>&1 > /var/log/cachet-monitor.log &`
|
|
|
|
```
|
|
Usage of cachet-monitor:
|
|
-c="/etc/cachet-monitor.config.json": Config path
|
|
-log="": Log path
|
|
-name="": System Name
|
|
```
|
|
|
|
Environment variables
|
|
---------------------
|
|
|
|
| Name | Example Value | Description |
|
|
| ------------ | ------------------------------ | --------------------------- |
|
|
| CACHET_API | http://demo.cachethq.io/api/v1 | URL endpoint for cachet api |
|
|
| CACHET_TOKEN | APIToken123 | API Authentication token |
|
|
| CACHET_DEV | 1 | Strips logging |
|
|
|
|
Vision and goals
|
|
----------------
|
|
|
|
We made this tool because we felt the need to have our own monitoring software (leveraging on Cachet).
|
|
The idea is a stateless program which collects data and pushes it to a central cachet instance.
|
|
|
|
This gives us power to have an army of geographically distributed loggers and reveal issues in both latency & downtime on client websites.
|