Log & resolve incidents, add readme

This commit is contained in:
Matej Kramny
2015-03-16 21:02:29 +01:00
parent f478ad9895
commit 92d8791a4f
4 changed files with 133 additions and 14 deletions

17
main.go
View File

@@ -1,25 +1,38 @@
package main
import (
"fmt"
"time"
"./cachet"
"github.com/castawaylabs/cachet-monitor/cachet"
)
func main() {
monitors := []*cachet.Monitor{
/*&cachet.Monitor{
Name: "nodegear frontend",
Url: "https://nodegear.io/ping",
MetricId: 1,
Threshold: 80.0,
ExpectedStatusCode: 200,
},*/
&cachet.Monitor{
Name: "local test server",
Url: "http://localhost:1337",
MetricId: 1,
Threshold: 80.0,
ExpectedStatusCode: 200,
},
}
fmt.Printf("Starting %d monitors:\n", len(monitors))
for _, monitor := range monitors {
fmt.Printf(" %s: GET %s & Expect HTTP %d\n", monitor.Name, monitor.Url, monitor.ExpectedStatusCode)
if monitor.MetricId > 0 {
fmt.Printf(" - Logs lag to metric id: %d\n", monitor.MetricId)
}
}
fmt.Println()
ticker := time.NewTicker(time.Second)
for _ = range ticker.C {
for _, monitor := range monitors {