~singpolyma/xmpp-certwatch

44c3bca5202fa649a4254572c1a47d5f28323bb1 — Stephen Paul Weber a month ago aff2449
Only alert of network errors the second time

To help with hosts that have flaky networks
1 files changed, 4 insertions(+), 2 deletions(-)

M cmd/cron/main.go
M cmd/cron/main.go => cmd/cron/main.go +4 -2
@@ 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)