All Projects → CastawayLabs → Cachet Monitor

CastawayLabs / Cachet Monitor

Licence: mit
Distributed monitoring plugin for CachetHQ

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Cachet Monitor

Wgcloud
linux运维监控工具,支持系统信息,内存,cpu,温度,磁盘空间及IO,硬盘smart,系统负载,网络流量等监控,API接口,大屏展示,拓扑图,进程监控,端口监控,docker监控,文件防篡改,日志监控,数据可视化,web ssh,堡垒机,指令下发批量执行,linux面板,探针,故障告警
Stars: ✭ 2,669 (+525.06%)
Mutual labels:  monitoring, devops
Minicron
🕰️ Monitor your cron jobs
Stars: ✭ 2,351 (+450.59%)
Mutual labels:  monitoring, devops
Awesome Sre Tools
A curated list of Site Reliability and Production Engineering Tools
Stars: ✭ 186 (-56.44%)
Mutual labels:  monitoring, devops
Promster
⏰A Prometheus exporter for Hapi, express and Marble.js servers to automatically measure request timings 📊
Stars: ✭ 146 (-65.81%)
Mutual labels:  monitoring, devops
Pyroscope
Continuous Profiling Platform! Debug performance issues down to a single line of code
Stars: ✭ 4,816 (+1027.87%)
Mutual labels:  monitoring, devops
Ostent
Ostent is a server tool to collect, display and report system metrics.
Stars: ✭ 171 (-59.95%)
Mutual labels:  monitoring, devops
Devops Readme.md
What to Read to Learn More About DevOps
Stars: ✭ 398 (-6.79%)
Mutual labels:  monitoring, devops
Defcon24 Infra Monitoring Workshop
Defcon24 Workshop Contents : Ninja Level Infrastructure Monitoring
Stars: ✭ 104 (-75.64%)
Mutual labels:  monitoring, devops
Netdata
Real-time performance monitoring, done right! https://www.netdata.cloud
Stars: ✭ 57,056 (+13262.06%)
Mutual labels:  monitoring, devops
Slacknimate
👯 Realtime text animation for Slack chatops
Stars: ✭ 250 (-41.45%)
Mutual labels:  monitoring, devops
Iopipe Js Core
Observe and develop serverless apps with confidence on AWS Lambda with Tracing, Metrics, Profiling, Monitoring, and more.
Stars: ✭ 123 (-71.19%)
Mutual labels:  monitoring, devops
Microsoft365dsc
Manages, configures, extracts and monitors Microsoft 365 tenant configurations
Stars: ✭ 374 (-12.41%)
Mutual labels:  monitoring, devops
Prom2teams
prom2teams is an HTTP server built with Python that receives alert notifications from a previously configured Prometheus Alertmanager instance and forwards it to Microsoft Teams using defined connectors
Stars: ✭ 122 (-71.43%)
Mutual labels:  monitoring, devops
Dockbix Agent Xxl
🐳 Dockerized Zabbix agent with Docker metrics and host metrics support for CoreOS, RHEL, CentOS, Ubuntu, Debian, Fedora, Boot2docker, Photon OS, Amazon Linux, ...
Stars: ✭ 177 (-58.55%)
Mutual labels:  monitoring, devops
Snowflake
Graphical SFTP client and terminal emulator with helpful utilities
Stars: ✭ 1,676 (+292.51%)
Mutual labels:  monitoring, devops
Sematext Agent Docker
Sematext Docker Agent - host + container metrics, logs & event collector
Stars: ✭ 194 (-54.57%)
Mutual labels:  monitoring, devops
Cloudprober
An active monitoring software to detect failures before your customers do.
Stars: ✭ 1,269 (+197.19%)
Mutual labels:  monitoring, devops
Mist Ce
Mist is an open source, multi-cloud management platform
Stars: ✭ 1,391 (+225.76%)
Mutual labels:  monitoring, devops
Dogo
Monitoring changes in the source file and automatically compile and run (restart).
Stars: ✭ 237 (-44.5%)
Mutual labels:  monitoring, devops
Healthchecks
A cron monitoring tool written in Python & Django
Stars: ✭ 4,297 (+906.32%)
Mutual labels:  monitoring, devops

screenshot

Features

  • [x] Creates & Resolves Incidents
  • [x] Posts monitor lag to cachet graphs
  • [x] HTTP Checks (body/status code)
  • [x] DNS Checks
  • [x] Updates Component to Partial Outage
  • [x] Updates Component to Major Outage if already in Partial Outage (works with distributed monitors)
  • [x] Can be run on multiple servers and geo regions

Example Configuration

Note: configuration can be in json or yaml format. example.config.json, example.config.yaml files.

api:
  # cachet url
  url: https://demo.cachethq.io/api/v1
  # cachet api token
  token: 9yMHsdioQosnyVK4iCVR
  insecure: false
# https://golang.org/src/time/format.go#L57
date_format: 02/01/2006 15:04:05 MST
monitors:
  # http monitor example
  - name: google
    # test url
    target: https://google.com
    # strict certificate checking for https
    strict: true
    # HTTP method
    method: POST
    
    # set to update component (either component_id or metric_id are required)
    component_id: 1
    # set to post lag to cachet metric (graph)
    metric_id: 4

    # custom templates (see readme for details)
    # leave empty for defaults
    template:
      investigating:
        subject: "{{ .Monitor.Name }} - {{ .SystemName }}"
        message: "{{ .Monitor.Name }} check **failed** (server time: {{ .now }})\n\n{{ .FailReason }}"
      fixed:
        subject: "I HAVE BEEN FIXED"
    
    # seconds between checks
    interval: 1
    # seconds for timeout
    timeout: 1
    # If % of downtime is over this threshold, open an incident
    threshold: 80

    # custom HTTP headers
    headers:
      Authorization: Basic <hash>
    # expected status code (either status code or body must be supplied)
    expected_status_code: 200
    # regex to match body
    expected_body: "P.*NG"
  # dns monitor example
  - name: dns
    # fqdn
    target: matej.me.
    # question type (A/AAAA/CNAME/...)
    question: mx
    type: dns
    # set component_id/metric_id
    component_id: 2
    # poll every 1s
    interval: 1
    timeout: 1
    # custom DNS server (defaults to system)
    dns: 8.8.4.4:53
    answers:
      # exact/regex check
      - regex: [1-9] alt[1-9].aspmx.l.google.com.
      - exact: 10 aspmx2.googlemail.com.
      - exact: 1 aspmx.l.google.com.
      - exact: 10 aspmx3.googlemail.com.

Installation

  1. Download binary from release page
  2. Add the binary to an executable path (/usr/bin, etc.)
  3. Create a configuration following provided examples
  4. cachet-monitor -c /etc/cachet-monitor.yaml

pro tip: run in background using nohup cachet-monitor 2>&1 > /var/log/cachet-monitor.log &, or use a tmux/screen session

Usage:
  cachet-monitor (-c PATH | --config PATH) [--log=LOGPATH] [--name=NAME] [--immediate]
  cachet-monitor -h | --help | --version

Arguments:
  PATH     path to config.json
  LOGPATH  path to log output (defaults to STDOUT)
  NAME     name of this logger

Examples:
  cachet-monitor -c /root/cachet-monitor.json
  cachet-monitor -c /root/cachet-monitor.json --log=/var/log/cachet-monitor.log --name="development machine"

Options:
  -c PATH.json --config PATH     Path to configuration file
  -h --help                      Show this screen.
  --version                      Show version
  --immediate                    Tick immediately (by default waits for first defined interval)
  
Environment varaibles:
  CACHET_API      override API url from configuration
  CACHET_TOKEN    override API token from configuration
  CACHET_DEV      set to enable dev logging

Init script

If your system is running systemd (like Debian, Ubuntu 16.04, Fedora, RHEL7, or Archlinux) you can use the provided example file: example.cachet-monitor.service.

  1. Simply put it in the right place with cp example.cachet-monitor.service /etc/systemd/system/cachet-monitor.service
  2. Then do a systemctl daemon-reload in your terminal to update Systemd configuration
  3. Finally you can start cachet-monitor on every startup with systemctl enable cachet-monitor.service! 👍

Templates

This package makes use of text/template. Default HTTP template

The following variables are available:

Root objects Description
.SystemName system name
.API api object from configuration
.Monitor monitor object from configuration
.now formatted date string
Monitor variables
.Name
.Target
.Type
.Strict
.MetricID
...

All monitor variables are available from monitor.go

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.

Package usage

When using cachet-monitor as a package in another program, you should follow what cli/main.go does. It is important to call Validate on CachetMonitor and all the monitors inside.

API Documentation

Contributions welcome

We'll happily accept contributions for the following (non exhaustive list).

  • Implement ICMP check
  • Implement TCP check
  • Any bug fixes / code improvements
  • Test cases
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].