A minimal monitoring tool
Go to file
Ian Fijolek 9dcd8ebf12
All checks were successful
continuous-integration/drone/push Build is passing
Update README to correct differences between py and go versions
2020-02-19 21:56:01 -08:00
scripts Update Dockerfiles to make this version runnable 2019-11-22 12:58:26 -08:00
test Add a default log alert 2020-02-19 17:38:07 -08:00
.drone.yml Add notify after docker builds 2020-01-10 14:25:02 -08:00
.gitignore Add multi-arch builds 2020-01-10 13:58:17 -08:00
.pre-commit-config.yaml Add pre-commit to the repo 2019-11-21 15:32:57 -08:00
alert_test.go Make Python compatability a flag 2020-02-19 17:38:07 -08:00
alert.go Make Python compatability a flag 2020-02-19 17:38:07 -08:00
config_test.go Make Python compatability a flag 2020-02-19 17:38:07 -08:00
config.go Make Python compatability a flag 2020-02-19 17:38:07 -08:00
Dockerfile Revert "Don't copy extra qemu files" 2020-01-30 11:41:34 -08:00
Dockerfile.multi-stage Update Dockerfiles to newer (roughly) pinned versions 2019-11-22 14:44:21 -08:00
go.mod Add prometheus metrics exporter 2019-11-15 17:14:20 -08:00
go.sum Add prometheus metrics exporter 2019-11-15 17:14:20 -08:00
LICENSE Add pre-commit to the repo 2019-11-21 15:32:57 -08:00
main_test.go Switch to a single key for command and command shell 2020-02-19 17:38:06 -08:00
main.go Make Python compatability a flag 2020-02-19 17:38:07 -08:00
Makefile Add multi-arch builds 2020-01-10 13:58:17 -08:00
manifest.tmpl Add multi-arch builds 2020-01-10 13:58:17 -08:00
metrics.go Add pre-commit to the repo 2019-11-21 15:32:57 -08:00
monitor_test.go Switch to a single key for command and command shell 2020-02-19 17:38:06 -08:00
monitor.go Switch to a single key for command and command shell 2020-02-19 17:38:06 -08:00
README.md Update README to correct differences between py and go versions 2020-02-19 21:56:01 -08:00
sample-config.yml Switch to a single key for command and command shell 2020-02-19 17:38:06 -08:00
util_test.go Refactor a bit more for testing, update tests 2019-10-04 14:47:38 -07:00
util.go Fix issue with shell commands containing "<>" and unecessary (and poor) escaping 2020-01-07 10:37:53 -08:00

minitor-go

A reimplementation of Minitor in Go

Minitor is already a minimal monitoring tool. Python 3 was a quick way to get something live, but Python itself comes with a large footprint. Thus Go feels like a better fit for the project, longer term.

Initial target is meant to be roughly compatible requiring only minor changes to configuration. Future iterations may diverge to take advantage of Go specific features.

Differences from Python version

Templating for Alert messages has been updated. In the Python version, str.format(...) was used with certain keys passed in that could be used to format messages. In the Go version, we use a struct, AlertNotice defined in alert.go and the built in Go templating format. Eg.

minitor-py:

alerts:
  log:
    command: 'echo {monitor_name}'

minitor-go:

alerts:
  log:
    command: 'echo {{.MonitorName}}'

For the time being, legacy configs for the Python version of Minitor should be compatible if you apply the -py-compat flag when running Minitor. Eventually, this flag will go away when later breaking changes are introduced.

Future

Future, potentially breaking changes

  • Implement leveled logging (maybe glog or logrus)
  • Consider value of templating vs injecting values into Env variables
  • Async checking
  • Revisit metrics and see if they all make sense
  • Consider dropping alert_up and alert_down in favor of using Go templates that offer more control of messaging (Breaking)
  • Use durations rather than seconds checked in event loop (Potentially breaking)