- customisable time format

- custom messages
- configure threshold count instead of uptime %
This commit is contained in:
Matej Kramny
2017-02-05 23:43:38 -08:00
parent b3bc1d4405
commit 0dc54e4e6e
5 changed files with 90 additions and 33 deletions

View File

@@ -8,11 +8,13 @@ import (
"strconv"
"strings"
"time"
"github.com/Sirupsen/logrus"
)
// Investigating template
var defaultHTTPInvestigatingTpl = MessageTemplate{
Subject: `{{ .Name }} - {{ .config.SystemName }}`,
Subject: `{{ .Monitor.Name }} - {{ .SystemName }}`,
Message: `{{ .Name }} check **failed** - {{ .now }}
{{ .lastFailReason }}`,
@@ -90,6 +92,7 @@ func (mon *HTTPMonitor) Validate() []string {
mon.Template.Fixed.SetDefault(defaultHTTPFixedTpl)
errs := mon.AbstractMonitor.Validate()
logrus.Warnf("%#v", mon.Template.Investigating)
if len(mon.ExpectedBody) > 0 {
exp, err := regexp.Compile(mon.ExpectedBody)