Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
BIND
BIND
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 641
    • Issues 641
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 105
    • Merge Requests 105
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ISC Open Source Projects
  • BINDBIND
  • Merge Requests
  • !3075

Open
Opened Feb 16, 2020 by Tony Finch@fanfContributor
  • Report abuse
Report abuse

Expose each zone's last refresh time via rndc and the stats channel

  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 5

When a zone is refreshed its file is touched by named. Checking the zone file's modification time is a good way to verify that secondary refreshes are working correctly. The last refresh time is good for this purpose since it can give the operator a reasonably prompt notification that somthing has broken with plenty of time to remediate, e.g. 24h after a zone stops updating is typically several days before the zone will break. If you try to alert based on the expiry time you either need to accommodate different expiry intervals in different zones (which is duplicating logic that already exists inside named), or set the alert to occur much closer to the time when a zone will break.

This patch adds the last refresh time alongside the other zone timing parameters in the output of rndc zonestatus, and it adds a similar selection of zone timing parameters to the statschannel output.

In servers that have a static configuration, named-checkconf -px is a handy way for a script to find out what zones are configured and where their files are, so that they can be checked for freshness. In a server with a dynamic configuration (using rndc addzone or catalog zones) the best way to get a list of zones is from the statschannel. This change gives monitoring scripts a simple one-stop shop for checking that all zones are reasonably fresh. For example, this script lists stale zones and when they were last refreshed:

curl -Ssf http://localhost:8053/json/v1/zones |
jq -r '.views[].zones[] |
	select(has("lastrefresh") and
		.lastrefresh < (now - 86400 | todate)) |
	"\(.lastrefresh) \(.name)"'
Edited Jun 17, 2020 by Ondřej Surý
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: isc-projects/bind9!3075
Source branch: u/fanf2/last-refresh