Skip to content

albertogviana/gochecks

 
 

Repository files navigation

#gochecks Build Status GoDoc

gochecks package provides utilities to check services health and publish events. It is written fully in Go.

It includes:

  • checks scheduler

  • add checks results

  • various checks:

    • Tcp port
    • ICMP/Ping
    • http
    • snmp get
    • rabbitmq queue len
    • Arris C4 CMTS temp
    • JunOS devices cpu usage and temp
    • MySQL connectivity
    • Jenkins jobs status
  • Publishers:

  • riemann

  • RabbitMQ / AMQP

##Install

go get github.com/aleasoluciones/gochecks

##Sample code

Create a Checks Engine with two publisher (riemman and log)

checkEngine := gochecks.NewCheckEngine([]gochecks.CheckPublisher{
    gochecks.NewRiemannPublisher("127.0.0.1:5555"),
    gochecks.NewLogPublisher(),
})

Add a periodic (20 seconds) http check with up to three retries, tagging the result as production and adding some attributes.

checkEngine.AddCheck(
    gochecks.NewHttpChecker("golang", "http", "http://www.golang.org", 200).
      Attributes(map[string]string{"version": "1", "network": "google"}).
      Tags("production").
      Retry(3, 1*time.Second),
    20 * time.Second)

##Development

Export vars: MYSQL_URL=mysql://:@/ AMQP_URL=qmqp://:@/

go test -tags integration -v ./...

##Todo

  • Metric for all the checks

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%