From 6e38a4cd55e8a8b51b578213e571c1eaff3fd745 Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Thu, 2 Dec 2010 21:34:42 +0200 Subject: Added configurable Statistics settings. Remove touch() of unbound log file at install time - this is all handled by syslog now. --- config/unbound/unbound.inc | 24 +++++++++++++++++++----- config/unbound/unbound.xml | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 5 deletions(-) (limited to 'config/unbound') diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc index 387212dc..873b012d 100644 --- a/config/unbound/unbound.inc +++ b/config/unbound/unbound.inc @@ -49,11 +49,11 @@ function unbound_initial_setup() { // Touch needed files @touch("/usr/local/etc/unbound/root.hints"); @touch("/usr/local/etc/unbound/root-trust-anchor"); + @touch("{$g['varlog_path']}/unbound.log"); // Ensure files and folders belong to unbound @chown("/usr/local/etc/unbound/root-trust-anchor", "unbound"); @chgrp("/usr/local/etc/unbound/root-trust-anchor", "wheel"); @chmod("/usr/local/etc/unbound/root-trust-anchor", 0600); - @chown("{$g['varlog_path']}/unbound.log", "unbound"); // We do not need the sample conf or the default rc.d startup file @unlink_if_exists("/usr/local/etc/unbound/unbound.conf.sample"); @unlink_if_exists("/usr/local/etc/rc.d/unbound"); @@ -281,6 +281,20 @@ function unbound_resync_config() { // Domain Overrides $domain_overrides = unbound_add_domain_overrides(); + // Unbound Statistics + if($unbound_config['stats'] == "on") { + $stats_interval = $unbound_config['stats_interval']; + $cumulative_stats = $unbound_config['cumulative_stats']; + if ($unbound_config['extended_stats'] == "on") + $extended_stats = "yes"; + else + $extended_stats = "no"; + } else { + $stats_interval = "0"; + $cumulative_stats = "no"; + $extended_stats = "no"; + } + $unbound_conf = << +?> \ No newline at end of file diff --git a/config/unbound/unbound.xml b/config/unbound/unbound.xml index 66bf8bd3..77b7bcd8 100644 --- a/config/unbound/unbound.xml +++ b/config/unbound/unbound.xml @@ -118,6 +118,45 @@ checkbox on + + stats + Enable Statistics + Unbound will log the number of queries that the resolver handles. + checkbox + stats_interval,cumulative_stats,extended_stats + + + stats_interval + Statistics Interval + Select the time as to when statistics will be written to the Unbound log file. + select + 3600 + + + + + + + + + + + cumulative_stats + Enable Cumulative Statistics + Once unbound is started, the statistics collected are cumulative and are not cleared after each report has been logged. + select + no + + + + + + + extended_stats + Enable Extended Statistics + In addition to collecting the total number of queries also collect what type of queries are handled by the resolver. + checkbox + -- cgit v1.2.3