easeprobe

module
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2022 License: Apache-2.0

README

EaseProbe

Go Report Card codecov Build GitHub go.mod Go version Join MegaEase Slack

EaseProbe is a simple, standalone, and lightweight tool that can do health/status checking, written in Go.

Table of Contents

1. Introduction

EaseProbe is designed to do three kinds of work - Probe, Notify, and Report.

1.1 Probe

EaseProbe supports a variety of methods to perform its probes such as:

  • HTTP. Checking the HTTP status code, Support mTLS, HTTP Basic Auth, and can set the Request Header/Body. ( HTTP Probe Configuration )
  • TCP. Check whether a TCP connection can be established or not. ( TCP Probe Configuration )
  • Shell. Run a Shell command and check the result. ( Shell Command Probe Configuration )
  • SSH. Run a remote command via SSH and check the result. Support the bastion/jump server (SSH Command Probe Configuration)
  • TLS. Connect to a given port using TLS and (optionally) validate for revoked or expired certificates ( TLS Probe Configuration )
  • Host. Run an SSH command on a remote host and check the CPU, Memory, and Disk usage. ( Host Load Probe )
  • Client. The following native clients are supported. They all supports the mTLS and the data checking, please refer to Native Client Probe Configuration
    • MySQL. Connect to a MySQL server and run the SHOW STATUS SQL.
    • Redis. Connect to a Redis server and run the PING command.
    • Memcache. Connect to a Memcache server and run the version command or validate a given key/value pair.
    • MongoDB. Connect to a MongoDB server and perform a ping.
    • Kafka. Connect to a Kafka server and perform a list of all topics.
    • PostgreSQL. Connect to a PostgreSQL server and run SELECT 1 SQL.
    • Zookeeper. Connect to a Zookeeper server and run get / command.

1.2 Notification

EaseProbe supports notification delivery to the following:

  • Slack. Using Slack Webhook for notification delivery
  • Discord. Using Discord Webhook for notification delivery
  • Telegram. Using Telegram Bot for notification delivery
  • Teams. Support the Microsoft Teams notification delivery
  • Email. Support email notification delivery to one or more email addresses
  • AWS SNS. Support the AWS Simple Notification Service
  • WeChat Work. Support Enterprise WeChat Work notification delivery
  • DingTalk. Support the DingTalk notification delivery
  • Lark. Support the Lark(Feishu) notification delivery
  • SMS. SMS notification delivery with support for multiple SMS service providers
  • Log. Write the notification into a log file or syslog.
  • Shell. Run a shell command to deliver the notification (see example)
  • RingCentral. Using RingCentral Webhook for notification delivery

Note:

  1. The notification is Edge-Triggered Mode, this means that these notifications are triggered when the status changes.

  2. Windows platforms do not support syslog as notification method.

Check the Notification Configuration to see how to configure it.

1.3 Report & Metrics

EaseProbe supports the following report and metrics:

  • SLA Report Notify. EaseProbe would send the daily, weekly, or monthly SLA report using the defined notify: methods.
  • SLA Live Report. The EaseProbe would listen on the 0.0.0.0:8181 port by default. By accessing this service you will be provided with live SLA report either as HTML at http://localhost:8181/ or as JSON at http://localhost:8181/api/v1/sla
  • SLA Data Persistence. The SLA data will be persisted in $CWD/data/data.yaml by default. You can configure this path by editing the settings section of your configuration file.

For more information, please check the Global Setting Configuration

  • Prometheus Metrics. The EaseProbe would listen on the 8181 port by default. By accessing this service you will be provided with Prometheus metrics at http://easeprobe:8181/metrics.

The metrics are prefixed with easeprobe_ and are documented in Prometheus Metrics Exporter

2. Getting Started

You can get started with EaseProbe, by any of the following methods:

2.1 Build

Compiler Go 1.18+ (Generics Programming Support), checking the Go Installation to see how to install Go on your platform.

Use make to build and produce the easeprobe binary file. The executable is produced under the build/bin directory.

$ make

2.2 Configure

Read the User Manual for detailed instructions on how to configure all EaseProbe parameters.

Create a configuration file (eg. $CWD/config.yaml) using the configuration template at ./resources/config.yaml, which includes the complete list of configuration parameters.

The following simple configuration example can be used to get started:

http: # http probes
  - name: EaseProbe Github
    url: https://github.com/megaease/easeprobe
notify:
  log:
    - name: log file # local log file
      file: /var/log/easeprobe.log
settings:
  probe:
    timeout: 30s # the time out for all probes
    interval: 1m # probe every minute for all probes

You can check the EaseProbe JSON Schema section to use a JSON Scheme file to make your life easier when you edit the configuration file.

2.3 Run

You can run the following command to start EaseProbe once built

$ build/bin/easeprobe -f config.yaml
  • -f configuration file or URL or path for multiple files which will be auto merged into one. Can also be achieved by setting the environment variable PROBE_CONFIG
  • -d dry run. Can also be achieved by setting the environment variable PROBE_DRY

3. User Manual

For detailed instructions and features please refer to the User Manual

4. Benchmark

We have performed an extensive benchmark on EaseProbe. For the benchmark results please refer to - Benchmark Report

5. Contributing

If you're interested in contributing to the project, please spare a moment to read our CONTRIBUTING Guide

6. Community

7. License

EaseProbe is under the Apache 2.0 license. See the LICENSE file for details.

Directories

Path Synopsis
Package channel implements the channel interface
Package channel implements the channel interface
cmd
easeprobe
Package main is the entry point for the easeprobe command.
Package main is the entry point for the easeprobe command.
Package conf is the configuration of the application
Package conf is the configuration of the application
Package daemon is the daemon implementation.
Package daemon is the daemon implementation.
Package eval is the package to eval the expression and extract the value from the document
Package eval is the package to eval the expression and extract the value from the document
Package global is the package for EaseProbe
Package global is the package for EaseProbe
Package metric is the package to report the metrics to Prometheus
Package metric is the package to report the metrics to Prometheus
Package notify contains the notify implementation.
Package notify contains the notify implementation.
aws
Package aws is the AWS notification package
Package aws is the AWS notification package
base
Package base is the base implementation of the notification.
Package base is the base implementation of the notification.
dingtalk
Package dingtalk is the notification package for dingtalk.
Package dingtalk is the notification package for dingtalk.
discord
Package discord is the notification for Discord
Package discord is the notification for Discord
email
Package email is the email notification package
Package email is the email notification package
lark
Package lark is the lark notification package.
Package lark is the lark notification package.
log
Package log is the log package for easeprobe.
Package log is the log package for easeprobe.
ringcentral
Package ringcentral is the ringcentral notification package.
Package ringcentral is the ringcentral notification package.
shell
Package shell is the shell probe package
Package shell is the shell probe package
slack
Package slack is the slack notification package.
Package slack is the slack notification package.
sms
Package sms contains the sms implementation.
Package sms contains the sms implementation.
sms/conf
Package conf is the configuration package for SMS notification
Package conf is the configuration package for SMS notification
sms/nexmo
Package nexmo is the nexmo sms notification package
Package nexmo is the nexmo sms notification package
sms/twilio
Package twilio is the twilio sms notification
Package twilio is the twilio sms notification
sms/yunpian
Package yunpian is the yunpian sms notification.
Package yunpian is the yunpian sms notification.
teams
Package teams is the teams notification
Package teams is the teams notification
telegram
Package telegram is the telegram notification package.
Package telegram is the telegram notification package.
wecom
Package wecom is the wecom notification package.
Package wecom is the wecom notification package.
Package probe contains the probe implementation.
Package probe contains the probe implementation.
base
Package base is the base package for all probes
Package base is the base package for all probes
client
Package client is the native client probe package
Package client is the native client probe package
client/conf
Package conf is the configuration package for native client
Package conf is the configuration package for native client
client/kafka
Package kafka is the native client probe for kafka.
Package kafka is the native client probe for kafka.
client/memcache
Package memcache is the native client probe for memcache
Package memcache is the native client probe for memcache
client/mongo
Package mongo implements a probe client for the MongoDB database.
Package mongo implements a probe client for the MongoDB database.
client/mysql
Package mysql is the client probe for MySQL.
Package mysql is the client probe for MySQL.
client/postgres
Package postgres is the native client probe for PostgreSQL
Package postgres is the native client probe for PostgreSQL
client/redis
Package redis is the native client probe for Redis
Package redis is the native client probe for Redis
client/zookeeper
Package zookeeper is the zookeeper client probe
Package zookeeper is the zookeeper client probe
host
Package host is the host probe package
Package host is the host probe package
http
Package http is the HTTP probe package.
Package http is the HTTP probe package.
shell
Package shell is the shell probe package
Package shell is the shell probe package
ssh
Package ssh is the ssh probe package
Package ssh is the ssh probe package
tcp
Package tcp is the tcp probe package
Package tcp is the tcp probe package
tls
Package tls is the tls probe package
Package tls is the tls probe package
Package report is the package for SLA report
Package report is the package for SLA report
Package web is the web server of easeprobe.
Package web is the web server of easeprobe.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL