From 24cf2a9ce867de6a7401df7b6c24961f4bf38e88 Mon Sep 17 00:00:00 2001 From: Petr Vokac Date: Mon, 13 Jan 2020 17:38:15 +0100 Subject: [PATCH] Add statistics-channels configuration Some monitoring tools access internal counters directly using statistics-channels (e.g. bind_exporter). This provides parametrized puppet configuration that can lead basically to statistics-channels { inet 127.0.0.1 port 8053 allow { 127.0.0.1; }; }; inserted ind ISC Bind named.conf --- manifests/server/conf.pp | 3 +++ templates/named.conf.erb | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/manifests/server/conf.pp b/manifests/server/conf.pp index 7944be2ee..fc329c364 100644 --- a/manifests/server/conf.pp +++ b/manifests/server/conf.pp @@ -104,6 +104,9 @@ $forward = undef, $server_id = undef, $version = undef, + $statistics_address = '127.0.0.1', + $statistics_port = '8053', + $statistics_acls = [], $dump_file = '/var/named/data/cache_dump.db', $statistics_file = '/var/named/data/named_stats.txt', $memstatistics_file = '/var/named/data/named_mem_stats.txt', diff --git a/templates/named.conf.erb b/templates/named.conf.erb index 39cd72b8c..5f8579705 100644 --- a/templates/named.conf.erb +++ b/templates/named.conf.erb @@ -101,6 +101,16 @@ options { bindkeys-file "/etc/named.iscdlv.key"; }; +<% if !@statistics_acls.empty? -%> +statistics-channels { + inet <%= @statistics_address %> port <%= @statistics_port %> allow { +<% @statistics_acls.each do |line| -%> + <%= line %>; +<% end -%> + }; +}; +<% end -%> + logging { channel main_log { file "/var/log/named/named.log" versions 3 size 5m;