gohc
gohc copied to clipboard
Healthcheck system in Golang
GoHC
GoHC was made to be a simple and lightweight healthcheck system made with Go (Golang).
Some project features:
- Lightweight (< 5 MB RAM memory)
- Healthcheck list is a simples JSON file - yes, you dont need one database!
- Healthcheck can have 3 types (ping, range and manual)
- Type "ping": will automatic change status by ping time
- Type "range": will automatic change status by range values (can be float)
- Type "manual": will change status using your sent status (work as a trigger)
- Have a warm time configuration, to only start run healthchecks after it (time is in milliseconds and is optional)
- Have a active timeout check for manual and range type (time is in milliseconds and is optional)
- Notification system based on plugins. Today GoHC implements its plugins:
- CLI
- Http Get
- SendGrid
- PushBullet
- Slack
- You can reload your healthchecks and notifiers file from web and API - dont need restart the GoHC
- The web interface is nice - made with Bulma and Vue.js
- It is open-source, you can collaborate reporting bugs and upgrading it
- You can DONATE!
You can see healthcheck list sample file with notifications inside: extras/sample/healthchecks.json
Configuration
GoHC configuration is a simple JSON file called "config.json" or what name you want.
Example of configuration file:
{
"server": {
"host": "0.0.0.0:8080",
"warmTime": 60000
},
"healthchecks": [
],
"notifiers": [
]
}
Sample files
I have created a sample healthcheck file and a sample config file. Check it on extras/sample directory.
Starting
- Execute: go get -u github.com/prsolucoes/gohc
- Execute: cd $GOPATH/src/github.com/prsolucoes/gohc
- Execute: make deps
- Execute: make install
- Create config file (config.json) based on some above example
- Execute: gohc -f config.json
- Open in your browser: http://localhost:8080
API
- update a ping = http://localhost:8080/api/update/ping/[TOKEN]
- update a range = http://localhost:8080/api/update/range/[TOKEN]/[VALUE-FLOAT-OR-INT]
- update manual = http://localhost:8080/api/update/manual/[TOKEN]/[SUCCESS-WARNING-OR-ERROR]
- reload healthchecks and notifiers file = http://localhost:8080/api/system/reload
Command line interface
You can use some make commands to control GoHC service, like start, stop and update from git repository.
- make stop = it will kill current GoHC process
- make update = it will update code from git and install on $GOPATH/bin directory
- make deps = download all dependencies
- make format = format all files (use it before make a pull-request)
So if you want start your server for example, you only need call "make start".
Alternative method to Build and Start project
- go build
- ./gohc -f config.json
Sugestion
Today, only some functions are implemented. If you need one, you can make a pull-request or send a message in Github Issue.
Screenshots
# HOME
# HEALTHCHECK LIST
# HEALTHCHECK CHART
# HEALTHCHECK DASHBOARD - FULL SCREEN
# HEALTHCHECK DASHBOARD - SMARTPHONE

Supported By Jetbrains IntelliJ IDEA
Author WebSite
http://www.pcoutinho.com
License
MIT