add support for specifying http-headers and really use Method spezified

This commit is contained in:
Tobias Knipping
2016-07-24 16:21:11 +02:00
parent 0de0baf5f9
commit 2c364f3d2f
4 changed files with 51 additions and 24 deletions

View File

@@ -53,9 +53,14 @@ func main() {
wg := &sync.WaitGroup{}
for _, mon := range cfg.Monitors {
cfg.Logger.Printf(" Starting %s: %d seconds check interval\n - %v %s (%d second/s timeout)", mon.Name, mon.CheckInterval, mon.Method, mon.URL, mon.HttpTimeout)
cfg.Logger.Printf(" Starting %s: %d seconds check interval - %v %s (%d second/s timeout)", mon.Name, mon.CheckInterval, mon.Method, mon.URL, mon.HttpTimeout)
// print features
if len(mon.HttpHeaders) > 0 {
for _, h := range mon.HttpHeaders {
cfg.Logger.Printf(" - Add HTTP-Header '%s' '%s'", h.Name, h.Value)
}
}
if mon.ExpectedStatusCode > 0 {
cfg.Logger.Printf(" - Expect HTTP %d", mon.ExpectedStatusCode)
}