@@ 88,8 88,10 @@ func main() {
result := CheckOne(host)
if result.Err != nil {
log.Printf("Error checking %s: %s\n", host, result.Err)
- rclient.HIncrBy(context.Background(), "mitm_monitor_hosts", host, 1)
- publish(host, fmt.Sprintf("Error checking %s: %s", host, result.Err))
+ errCount, _ := rclient.HIncrBy(context.Background(), "mitm_monitor_hosts", host, 1).Result()
+ if errCount > 1 {
+ publish(host, fmt.Sprintf("Error checking %s: %s", host, result.Err))
+ }
} else if !result.Dnssec {
log.Printf("No DNSSEC for %s\n", host)
rclient.HIncrBy(context.Background(), "mitm_monitor_hosts", host, 1)