Detects hostname/interface ip
- Hostname is monitor's id. Incidents will be created with the monitor id.
This commit is contained in:
18
main.go
18
main.go
@@ -7,12 +7,14 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Printf("API: %s\n", cachet.Config.APIUrl)
|
||||
fmt.Printf("Starting %d monitors:\n", len(cachet.Config.Monitors))
|
||||
for _, monitor := range cachet.Config.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)
|
||||
config := cachet.Config
|
||||
|
||||
fmt.Printf("System: %s, API: %s\n", config.SystemName, config.APIUrl)
|
||||
fmt.Printf("Starting %d monitors:\n", len(config.Monitors))
|
||||
for _, mon := range config.Monitors {
|
||||
fmt.Printf(" %s: GET %s & Expect HTTP %d\n", mon.Name, mon.URL, mon.ExpectedStatusCode)
|
||||
if mon.MetricID > 0 {
|
||||
fmt.Printf(" - Logs lag to metric id: %d\n", mon.MetricID)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +22,8 @@ func main() {
|
||||
|
||||
ticker := time.NewTicker(time.Second)
|
||||
for range ticker.C {
|
||||
for _, monitor := range cachet.Config.Monitors {
|
||||
go monitor.Run()
|
||||
for _, mon := range config.Monitors {
|
||||
go mon.Run()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user