Skip to content

Added the ability to set up statistics channels via a statistics_channel... #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,27 @@ bind::server::conf {
}
```

You can use the `statistics_channels` parameter to set up one or more statistics channels.

`statistics_channels` is a hash of hashes. Each nested hash sets up a statistics channel
and contains the listening IP address and port for the channel and the IP addresses/address
blocks or ACLs that are allowed to access the channel:

```puppet
bind::server::conf { '/etc/named.conf':
...
statistics_channels => {
'channel-1' => {
listen_address => '*',
listen_port => '8053',
allow => ['127.0.0.1', '10.0.0.0/8'],
},
'channel-2' => {
listen_address => '*',
listen_port => '8054',
allow => ['127.0.0.1', '10.0.0.0/8'],
},
},
...
}
```
5 changes: 5 additions & 0 deletions manifests/server/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
# $memstatistics_file:
# Memory statistics file for the server.
# Default: '/var/named/data/named_mem_stats.txt'
# $statistics_channels:
# Hash of hashes; each nested hash contains the listening IP address and listening port
# for a statistics channel webpage and an array of ACLs or IP addresses/address blocks
# that are allowed to access it. Defaults to empty.
# $allow_query:
# Array of IP addrs or ACLs to allow queries from. Default: [ 'localhost' ]
# $recursion:
Expand Down Expand Up @@ -94,6 +98,7 @@
$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',
$statistics_channels = {},
$allow_query = [ 'localhost' ],
$allow_query_cache = [],
$recursion = 'yes',
Expand Down
13 changes: 13 additions & 0 deletions templates/named.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ masters <%= key %> {

<% end -%>
<% end -%>

<% if !@statistics_channels.empty? -%>
statistics-channels {
<% @statistics_channels.each do |stat_channel,stat_channel_settings|-%>
<%- if stat_channel_settings.is_a?(Hash) -%>
<%- if stat_channel_settings['listen_address'] and !stat_channel_settings['listen_address'].empty? and stat_channel_settings['listen_port'] and !stat_channel_settings['listen_port'].empty? -%>
inet <%=stat_channel_settings['listen_address']%> port <%= stat_channel_settings['listen_port'] %> allow { <%=stat_channel_settings['allow'].join("; ")%>; };
<%- end -%>
<%- end -%>
<%- end -%>
};
<%- end -%>

options {
<% if @listen_on_port -%>
listen-on port <%= @listen_on_port %> { <%= @listen_on_addr.join("; ") %>; };
Expand Down