INNER CODE UNIT · Go

Post7MOORphonecall

feiyu563/PrometheusAlert · controllers/7moor.go:123

func Post7MOORphonecall(Messages string, PhoneNumbers, logsign string) string {
	var errorCollector []string
	mobiles := strings.Split(PhoneNumbers, ",")
	for _, mobile := range mobiles {
		res := webcallPost(Messages, mobile, logsign)
		if !strings.Contains(res, `"statusCode":0`) {
			errorCollector = append(errorCollector, fmt.Sprintf("to %s failed: %s", mobile, res))
		}
	}
	models.AlertToCounter.WithLabelValues("7moordh").Add(1)
	ChartsJson.Smoordh += 1
	if len(errorCollector) > 0 {
		return strings.Join(errorCollector, "; ")
	}
	return PhoneNumbers + " all called successfully."
}

// webcallPost makes phonecall by 7moor webcall

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…