|
@@ -6,6 +6,7 @@ import (
|
6
|
6
|
"metrics-alerting/config"
|
7
|
7
|
"metrics-alerting/script_data"
|
8
|
8
|
|
|
9
|
+ "github.com/sirupsen/logrus"
|
9
|
10
|
"gopkg.in/gomail.v2"
|
10
|
11
|
)
|
11
|
12
|
|
|
@@ -20,6 +21,12 @@ func (a *Alerter) Alert(
|
20
|
21
|
labels map[string]string,
|
21
|
22
|
data script_data.Data,
|
22
|
23
|
) error {
|
|
24
|
+ alertLog := fmt.Sprintf("Test for script \"%s\" failed", script.Key)
|
|
25
|
+ if len(data.Key) > 0 {
|
|
26
|
+ alertLog = alertLog + fmt.Sprintf(" (data: %s=%s)", data.Key, data.Value)
|
|
27
|
+ }
|
|
28
|
+ logrus.Info(alertLog)
|
|
29
|
+
|
23
|
30
|
switch script.Action {
|
24
|
31
|
case "http":
|
25
|
32
|
return a.alertHttp(script, result, labels, data)
|