slack: webhookurl and sendSlack

- GetComponentStatus fix
- get main url from api definition for slack post
- fix run send slack
This commit is contained in:
Christoph Eck
2020-01-27 18:36:05 +01:00
parent 2963a9f610
commit 79676357f3
3 changed files with 19 additions and 12 deletions

View File

@@ -89,3 +89,9 @@ func getTemplateData(monitor *AbstractMonitor) map[string]interface{} {
"now": time.Now().Format(monitor.config.DateFormat),
}
}
func MainUrl(cfg *CachetMonitor) string {
var url = cfg.API.URL
var index = strings.Index(url,"/api/")
return url[0:index]
}