Tiny service health dashboard written in Go

Overview

GreenWall

Logo of GreenWall

Status: Done (waiting for feedback)

Build Status

Description

GreenWall is a tiny service health dashboard written in Go (with frontend prepared in Bootstrap). The aim of this project is to develop a small web application that can be run as a live dashboard, which presents health statuses of specified server nodes.

The app can be installed in a couple of seconds thus do not hesitate to run this on your operational wall screens!

Screenshots

Desktop view

Screenshot Desktop

Mobile view

Screenshot Mobile

Features

  • web live dashboard based on Bootstrap
  • easily resizeable dashboard (wall, desktop, mobile screens)
  • definition of monitored hosts in a YAML file
  • HTTP endpoint can be used as source of health information
  • HTTP basic access authentication
  • search for "healthy" phrases in HTTP responses
  • ICMP ping
  • check expired SSL certificates with TLS health check
  • pluggable health checks (waiting for TCP, DNS, REST, SOAP and others!)
  • install and run in a few seconds!

Quickstart

Download and install GreenWall:

go get github.com/mtojek/greenwall

Prepare a YAML file (config.yaml) with definitions of monitored hosts:

---
general:
  healthcheckEvery: 15s
  httpClientTimeout: 5s
  refreshDashboardEvery: 10s
groups:
  - name: Frontend Nodes (us-east-1)
    nodes:
      - name: front-1
        endpoint: https://httpbin.org/basic-auth/username/password
        type: http_check
        parameters:
            expectedPattern: "\"authenticated\": true"
            basicAuthUsername: username
            basicAuthPassword: password
      - name: front-2
        endpoint: https://www.example.com/
        type: http_check
        parameters:
            expectedPattern: WillNotFindThis
  - name: Middleware Nodes (us-west-2)
    nodes:
      - name: middleware-1 with a really long name
        endpoint: https://www.example.com/
        type: http_check
      - name: middleware-2
        endpoint: https://www.example.com/
        type: http_check
  - name: Backend Nodes (us-west-2)
    nodes:
      - name: backend-1
        endpoint: https://www.example.com/
        type: http_check
      - name: backend-2
        endpoint: https://www.example.com/
        type: http_check
      - name: backend-3
        endpoint: https://www.example.com/
        type: http_check
      - name: backend-4
        endpoint: https://1234567890.example.com/
        type: http_check
      - name: backend-5
        endpoint: https://www.example.com/
        type: http_check

Run the application:

greenwall -staticDir $GOPATH/src/github.com/mtojek/greenwall/frontend

Go to the live dashboard:

http://localhost:9001

Running in cloud - Heroku, Cloud Foundry, etc.

As an alternative to command line arguments, GreenWall can also read primary configuration (host, port, config file, static path, etc.) from environment variables. Names of variables can be listed with a -help switch.

Sample command:

PORT=9001 CONFIG=config.yaml STATIC_DIR=frontend greenwall

Building

The project may be rebuilt using a single command - make. This includes downloading dependencies, formatting, building code and testing.

The building process may require higher user permission:

--- PASS: TestLint (8.93s)
PASS
ok      github.com/greenwall    8.932s
?       github.com/greenwall/middleware/application     [no test files]
?       github.com/greenwall/middleware/healthcheck     [no test files]
?       github.com/greenwall/middleware/httpserver      [no test files]
?       github.com/greenwall/middleware/monitoring      [no test files]
go test -race  -i ./...
go install runtime/internal/sys: open /usr/lib/golang/pkg/linux_amd64_race/runtime/internal/sys.a: permission denied
make: *** [test] Error 1
[[email protected] greenwall]$

To resolve this issue, please elevate user permissions with sudo or use local Go installation.

Creating own, pluggable health check

The author is welcome to any contributions to this project, especially new health check types. To create a new plugin, please look at first into sample implementation of SampleCheck. This check is responsible for comparing the current day with a "green day" provided in configuration.

See: sample_check.go

High priority health check plugins:

  • TCP
  • DNS
  • REST
  • SOAP

Please open a PR once you finish the implementation. Don't worry - I'll help you in pushing your change to the repository!

Dist

It is possible to build a GreenWall distribution (dist.zip), which can be easily installed on the target host. Firstly, prepare a distribution:

make dist

Then copy the dist.zip file to the target host and unzip it. Please remember also to provide a config.yaml file before running the ./greenwall binary.

Contact

Please feel free to leave any comment or feedback by opening a new issue or contacting me directly via email. Thank you.

License

MIT License, see LICENSE file.

Comments
  • Current build need to have local install go instance

    Current build need to have local install go instance

    Hi

    Following is error on CentOS 7.3 with default system golang 1.6.3 rpm instance. I installed the golang tarball into my $HOME/go to get the build successfully. Adding this note in readme.md to alert user(beginner like me;) might be helpful.

    --- PASS: TestLint (8.93s)
    PASS
    ok      github.com/greenwall    8.932s
    ?       github.com/greenwall/middleware/application     [no test files]
    ?       github.com/greenwall/middleware/healthcheck     [no test files]
    ?       github.com/greenwall/middleware/httpserver      [no test files]
    ?       github.com/greenwall/middleware/monitoring      [no test files]
    go test -race  -i ./...
    go install runtime/internal/sys: open /usr/lib/golang/pkg/linux_amd64_race/runtime/internal/sys.a: permission denied
    make: *** [test] Error 1
    [[email protected] greenwall]$
    
    
    opened by tjyang 4
  • Support PORT from environment variable

    Support PORT from environment variable

    Why

    As of now there is no way to specify port using environment variable , which is used for most of cloud platform , eg heroku , cloudfoundry.

    Changes

    • Provision to use PORT from environment variable.
    • Add UI message for server start along with PORT in use
    opened by ronakbanka 3
  • Support HTTP health check with Basic Authentication

    Support HTTP health check with Basic Authentication

    Hi

    I required HTTP health check with Basic Authentication, so this PR is for that features.

    • add basicAuthUsername parameter
    • add basicAuthPassword parameter
    • If both parameters specified, GET request with authentication

    Then, greenwall is so cool!

    opened by stormcat24 1
  • Support PORT from environment variable

    Support PORT from environment variable

    User @ronakbanka asked for an alternative source of application configuration - environment. There should be a switch in command line args which will force the application to read config entirely from env vars.

    enhancement 
    opened by mtojek 0
  • After some times, greenwall crashes for too many open files

    After some times, greenwall crashes for too many open files

    Dear all, after a while greenwall is having some issues with the number of open files:

    Aug 06 13:09:39 falcon greenwall[5769]: 2019/08/06 13:09:39 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:39 falcon greenwall[5769]: 2019/08/06 13:09:39 Get http://localhost/webanno/login.html: dial tcp: lookup localhost: device or resource busy
    Aug 06 13:09:40 falcon greenwall[5769]: 2019/08/06 13:09:40 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:41 falcon greenwall[5769]: 2019/08/06 13:09:41 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:42 falcon greenwall[5769]: 2019/08/06 13:09:42 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:43 falcon greenwall[5769]: 2019/08/06 13:09:43 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:44 falcon greenwall[5769]: 2019/08/06 13:09:44 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:45 falcon greenwall[5769]: 2019/08/06 13:09:45 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:46 falcon greenwall[5769]: 2019/08/06 13:09:46 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:47 falcon greenwall[5769]: 2019/08/06 13:09:47 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:48 falcon greenwall[5769]: 2019/08/06 13:09:48 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:49 falcon greenwall[5769]: 2019/08/06 13:09:49 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:50 falcon greenwall[5769]: 2019/08/06 13:09:50 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    Aug 06 13:09:51 falcon greenwall[5769]: 2019/08/06 13:09:51 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 1s
    

    If I restart the service everything goes back to normal...

    I've checked the open files and it seems that the connections are not closed correctly, perhaps something wrong in my configuration?

    Redirecting to /bin/systemctl start greenwall.service
    (base) [[email protected] ~]$ lsof | grep greenwall | wc -l 
    77
    (base) [[email protected] ~]$ lsof | grep greenwall | wc -l 
    306
    (base) [[email protected] ~]$ lsof | grep greenwall | wc -l 
    920
    

    and here a more detailed view:

    greenwall 31633          Luca   44u     IPv6              67288          0t0        TCP localhost:56530->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   45u     IPv6             303313          0t0        TCP localhost:56534->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   46u     IPv6              67295          0t0        TCP localhost:56564->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   47u     IPv6              72439          0t0        TCP localhost:56518->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   48u     IPv6              72454          0t0        TCP localhost:56546->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   49u     IPv6             304148          0t0        TCP localhost:56566->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   50u     IPv6             303831          0t0        TCP localhost:56568->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   51u     IPv6              77354          0t0        TCP localhost:56567->localhost:http (CLOSE_WAIT)
    greenwall 31633          Luca   52u     IPv6              70510          0t0        TCP localhost:56578->localhost:http (CLOSE_WAIT)
    (base) [[email protected] ~]$ 
    

    I'm running it with Centos 7.

    opened by lfoppiano 0
  • Add more types of health checks

    Add more types of health checks

    New types of health checks can be easily defined. Right now it requires only creating a single, new file assuming that it is not necessary to update global configuration.

    Expected plugins (first) Ping, DNS, TCP, TLS (expired SSL certificate), REST, SOAP

    enhancement 
    opened by mtojek 2
  • Add live reload of config

    Add live reload of config

    From reddit:

    pafortin wrote:

    my only comments would be to reload the config once in a while and also change the UI to a client side pull of an API call to avoid reloading the entire page every X seconds!

    enhancement 
    opened by mtojek 0
Owner
Marcin Tojek
Marcin Tojek
Collection of personal Dapr demos (bindings, state, pub/sub, service-to-service invocation)

Dapr demos Collection of personal Dapr demos. Note, some of these demos require latest version of Dapr, Ingress gateway, Observability components, or

Mark Chmarny 159 Nov 14, 2022
🦄🌈 YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go.

???? YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go. Support Nacos ,Consoul ,Etcd ,Eureka ,kubernetes.

YoyoFx 557 Nov 22, 2022
Micro-service framework in Go

Kite Micro-Service Framework Kite is a framework for developing micro-services in Go. Kite is both the name of the framework and the micro-service tha

Koding, Inc. 3.2k Nov 20, 2022
NewSQL distributed storage database based on micro service framework

QLite 是基于微服务的 NewSQL 型数据库系统,与传统的一体化数据库不同,该系统将本该内置的多种数据结构(STL)拆分成多个服务模块,每个模块都是独立的一个节点,每个节点都与其主网关进行连接,从而形成分布式存储结构。

null 36 Jun 19, 2022
High Performance Remote Object Service Engine

=============== Hprose is a High Performance Remote Object Service Engine. It is a modern, lightweight, cross-language, cross-platform, object-oriente

小马哥 615 Nov 3, 2022
Kubernetes as a Service

Go Report Travis CircleCI Azure Test Azure Release License oneinfra oneinfra is a Kubernetes as a Service platform. It empowers you to provide or cons

null 881 Nov 9, 2022
🔥 Kubernetes multi-cluster deployment automation service.

Beetle Kubernetes multi-cluster deployment automation service ?? Check out the demo! Application deployment and management should be automated, audita

Ahmed 162 Nov 9, 2022
Automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio.

Mesh RPC MeshRPC provides automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio. In a nutshell

AstraNet Toolkit 69 Aug 22, 2022
Check if an IP address is part of an Azure Service Tag

Cloud IP Checker This service will help you determine whether an IP address is within one of the Azure Service Tag network ranges. If it is found, it

Dean Bryen 26 Nov 13, 2022
Another excellent micro service framework

xservice [WIP] Another excellent micro service framework Features RESTful API (base on echo/v4) gRPC & gRPC gateway service & Swagger document generat

新片场 9 May 28, 2022
EaseMesh is a service mesh that is compatible with the Spring Cloud ecosystem.

A service mesh implementation for connecting, control, and observe services in spring-cloud.

MegaEase 440 Nov 14, 2022
Access to b2c microservices through this service

API service Access to b2c microservices through this service Config file Create config file with services addresses. Services: vdc - get camera inform

Artem 0 Nov 8, 2021
This is a template service for development first with go monolithic architecture

This is a template service for development first with go monolithic architecture

Muhammad Rivaldy 1 Oct 28, 2021
A Go implementation of twtxt - decentralised, minimalist microblogging service for hackers

GoTwtxt A Go implementation of twtxt - decentralised, minimalist microblogging service for hackers Usage: Send a tweet: # pass the message on the cli

Alice 5 Nov 9, 2022
A Go implementation of twtxt - decentralised, minimalist microblogging service for hackers

GoTwtxt A Go implementation of twtxt - decentralised, minimalist microblogging service for hackers Usage: Send a tweet: # pass the message on the cli

Alice 4 Nov 5, 2021
The Consul API Gateway is a dedicated ingress solution for intelligently routing traffic to applications running on a Consul Service Mesh.

The Consul API Gateway is a dedicated ingress solution for intelligently routing traffic to applications running on a Consul Service Mesh.

HashiCorp 85 Nov 15, 2022
Meshery, the service mesh management plane

Meshery is the multi-service mesh management plane offering lifecycle, configuration, and performance management of service meshes and their workloads.

Meshery 1.6k Nov 21, 2022
A microservices-demo service that provides catalogue/product information.

A microservices-demo service that provides catalogue/product information. This service is built, tested and released by travis.

null 1 Nov 22, 2021
A microservices-demo service that provides catalogue/product information.

A microservices-demo service that provides catalogue/product information. This service is built, tested and released by travis.

Park Won Gyun 0 Nov 28, 2021