Skip to content
Snippets Groups Projects
Commit 5c4f0c2e authored by Matej Kramny's avatar Matej Kramny
Browse files

Print descriptions from cli

parent 9d0e1766
Branches
Tags
No related merge requests found
...@@ -53,6 +53,22 @@ func main() { ...@@ -53,6 +53,22 @@ func main() {
wg := &sync.WaitGroup{} wg := &sync.WaitGroup{}
for _, mon := range cfg.Monitors { for _, mon := range cfg.Monitors {
cfg.Logger.Printf(" Starting %s: %d seconds check interval\n - %v %s", mon.Name, mon.CheckInterval, mon.Method, mon.URL)
// print features
if mon.ExpectedStatusCode > 0 {
cfg.Logger.Printf(" - Expect HTTP %d", mon.ExpectedStatusCode)
}
if len(mon.ExpectedBody) > 0 {
cfg.Logger.Printf(" - Expect Body to match \"%v\"", mon.ExpectedBody)
}
if mon.MetricID > 0 {
cfg.Logger.Printf(" - Log lag to metric id %d\n", mon.MetricID)
}
if mon.ComponentID > 0 {
cfg.Logger.Printf(" - Update component id %d\n\n", mon.ComponentID)
}
go mon.Start(cfg, wg) go mon.Start(cfg, wg)
} }
......
...@@ -48,23 +48,6 @@ func (mon *Monitor) Start(cfg *CachetMonitor, wg *sync.WaitGroup) { ...@@ -48,23 +48,6 @@ func (mon *Monitor) Start(cfg *CachetMonitor, wg *sync.WaitGroup) {
wg.Add(1) wg.Add(1)
mon.config = cfg mon.config = cfg
mon.stopC = make(chan bool) mon.stopC = make(chan bool)
mon.config.Logger.Printf(" Starting %s: %d seconds check interval\n - %v %s", mon.Name, mon.CheckInterval, mon.Method, mon.URL)
// print features
if mon.ExpectedStatusCode > 0 {
mon.config.Logger.Printf(" - Expect HTTP %d", mon.ExpectedStatusCode)
}
if len(mon.ExpectedBody) > 0 {
mon.config.Logger.Printf(" - Expect Body to match \"%v\"", mon.ExpectedBody)
}
if mon.MetricID > 0 {
mon.config.Logger.Printf(" - Log lag to metric id %d\n", mon.MetricID)
}
if mon.ComponentID > 0 {
mon.config.Logger.Printf(" - Update component id %d\n\n", mon.ComponentID)
}
mon.Tick() mon.Tick()
ticker := time.NewTicker(mon.CheckInterval * time.Second) ticker := time.NewTicker(mon.CheckInterval * time.Second)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment