{{/* ---- Header ---- */}}

dnswatcher

state updated {{ .StateAge }} · page generated {{ .GeneratedAt }} UTC · auto-refresh 30s

{{/* ---- Summary bar ---- */}}
Domains
{{ len .Snapshot.Domains }}
Hostnames
{{ len .Snapshot.Hostnames }}
Ports
{{ len .Snapshot.Ports }}
Certificates
{{ len .Snapshot.Certificates }}
{{/* ---- Domains ---- */}}

Domains

{{ if .Snapshot.Domains }}
{{ range $name, $ds := .Snapshot.Domains }} {{ end }}
Domain Nameservers Checked
{{ $name }} {{ joinStrings $ds.Nameservers ", " }} {{ relTime $ds.LastChecked }}
{{ else }}

No domains configured.

{{ end }}
{{/* ---- Hostnames ---- */}}

Hostnames

{{ if .Snapshot.Hostnames }}
{{ range $name, $hs := .Snapshot.Hostnames }} {{ range $ns, $nsr := $hs.RecordsByNameserver }} {{ end }} {{ end }}
Hostname NS Status Records Checked
{{ $name }} {{ $ns }} {{ if eq $nsr.Status "ok" }} ok {{ else }} {{ $nsr.Status }} {{ end }} {{ formatRecords $nsr.Records }} {{ relTime $nsr.LastChecked }}
{{ else }}

No hostnames configured.

{{ end }}
{{/* ---- Ports ---- */}}

Ports

{{ if .Snapshot.Ports }}
{{ range $key, $ps := .Snapshot.Ports }} {{ end }}
Address State Hostnames Checked
{{ $key }} {{ if $ps.Open }} open {{ else }} closed {{ end }} {{ joinStrings $ps.Hostnames ", " }} {{ relTime $ps.LastChecked }}
{{ else }}

No port data yet.

{{ end }}
{{/* ---- Certificates ---- */}}

Certificates

{{ if .Snapshot.Certificates }}
{{ range $key, $cs := .Snapshot.Certificates }} {{ end }}
Endpoint Status CN Issuer Expires Checked
{{ $key }} {{ if eq $cs.Status "ok" }} ok {{ else }} {{ $cs.Status }} {{ end }} {{ $cs.CommonName }} {{ $cs.Issuer }} {{ if not $cs.NotAfter.IsZero }} {{ $days := expiryDays $cs.NotAfter }} {{ if lt $days 7 }} {{ $cs.NotAfter.Format "2006-01-02" }} ({{ $days }}d) {{ else if lt $days 30 }} {{ $cs.NotAfter.Format "2006-01-02" }} ({{ $days }}d) {{ else }} {{ $cs.NotAfter.Format "2006-01-02" }} ({{ $days }}d) {{ end }} {{ end }} {{ relTime $cs.LastChecked }}
{{ else }}

No certificate data yet.

{{ end }}
{{/* ---- Recent Alerts ---- */}}

Recent Alerts ({{ len .Alerts }})

{{ if .Alerts }}
{{ range .Alerts }}
{{ if eq .Priority "error" }} error {{ else if eq .Priority "warning" }} warning {{ else if eq .Priority "success" }} success {{ else }} info {{ end }} {{ .Title }} {{ .Timestamp.Format "2006-01-02 15:04:05" }} UTC ({{ relTime .Timestamp }})

{{ .Message }}

{{ end }}
{{ else }}

No alerts recorded since last restart.

{{ end }}
{{/* ---- Footer ---- */}}
dnswatcher · monitoring {{ len .Snapshot.Domains }} domains + {{ len .Snapshot.Hostnames }} hostnames