update
This commit is contained in:
1 parent
0690285147
commit
5618cd2738
154 files changed
+5021
-3161
No files matched your search
@@ -79,16 +79,16 @@ func notifyTemplateVars(ruleName, hostname, metric, severity, message string, va
|
||||
platform = defaultNotifyPlatformName
|
||||
}
|
||||
return map[string]string{
|
||||
"time": time.Now().Format("2006-01-02 15:04:05"),
|
||||
"platform": platform,
|
||||
"rule_name": ruleName,
|
||||
"hostname": hostname,
|
||||
"metric": metric,
|
||||
"severity": severity,
|
||||
"severity_label": sevLabel,
|
||||
"message": message,
|
||||
"value": fmt.Sprintf("%.2f", value),
|
||||
"threshold": fmt.Sprintf("%.2f", threshold),
|
||||
"time": time.Now().Format("2006-01-02 15:04:05"),
|
||||
"platform": platform,
|
||||
"rule_name": ruleName,
|
||||
"hostname": hostname,
|
||||
"metric": metric,
|
||||
"severity": severity,
|
||||
"severity_label": sevLabel,
|
||||
"message": message,
|
||||
"value": fmt.Sprintf("%.2f", value),
|
||||
"threshold": fmt.Sprintf("%.2f", threshold),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,4 +134,4 @@ func buildAlertContent(ruleName, hostname, metric, severity, message string, val
|
||||
"**规则名称:** %s\\n**目标主机:** %s\\n**指标类型:** %s\\n**告警级别:** %s\\n**当前值:** %.2f\\n**阈值:** %.2f\\n**详细信息:** %s\\n**触发时间:** %s",
|
||||
ruleName, hostname, metric, severity, value, threshold, message, time.Now().Format("2006-01-02 15:04:05"),
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user