Project

General

Profile

Download (4.79 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * status_unbound.php
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2013 BSD Perimeter
7
 * Copyright (c) 2013-2016 Electric Sheep Fencing
8
 * Copyright (c) 2014-2024 Rubicon Communications, LLC (Netgate)
9
 * All rights reserved.
10
 *
11
 * Licensed under the Apache License, Version 2.0 (the "License");
12
 * you may not use this file except in compliance with the License.
13
 * You may obtain a copy of the License at
14
 *
15
 * http://www.apache.org/licenses/LICENSE-2.0
16
 *
17
 * Unless required by applicable law or agreed to in writing, software
18
 * distributed under the License is distributed on an "AS IS" BASIS,
19
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
 * See the License for the specific language governing permissions and
21
 * limitations under the License.
22
 */
23

    
24
##|+PRIV
25
##|*IDENT=page-status-dns-resolver
26
##|*NAME=Status: DNS Resolver
27
##|*DESCR=Allow access to the 'Status: DNS Resolver' page.
28
##|*MATCH=status_unbound.php*
29
##|-PRIV
30

    
31
require_once("guiconfig.inc");
32

    
33
$pgtitle = array(gettext("Status"), gettext("DNS Resolver"));
34
$shortcut_section = "resolver";
35

    
36
include("head.inc");
37

    
38
$infra_cache_entries = array();
39
$errors = "";
40

    
41
// Check if unbound is enabled and running, bail if not
42
if (!config_path_enabled('unbound') || !is_service_running('unbound')) {
43
	print_info_box(gettext("The DNS Resolver is disabled or stopped."), 'warning', false);
44
} else {
45
	exec("/usr/local/sbin/unbound-control -c {$g['unbound_chroot_path']}/unbound.conf dump_infra", $infra_cache_entries, $ubc_ret);
46
}
47

    
48
?>
49

    
50
<div class="panel panel-default">
51
	<div class="panel-heading"><h2 class="panel-title"><?=gettext("DNS Resolver Infrastructure Cache Speed")?></h2></div>
52
	<div class="panel-body">
53
		<div class="table-responsive">
54
			<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
55
				<thead>
56
					<tr>
57
						<th><?=gettext("Server")?></th>
58
						<th><?=gettext("Zone")?></th>
59
						<th><?=gettext("TTL")?></th>
60
						<th><?=gettext("Ping")?></th>
61
						<th><?=gettext("Var")?></th>
62
						<th><?=gettext("RTT")?></th>
63
						<th><?=gettext("RTO")?></th>
64
						<th><?=gettext("Timeout A")?></th>
65
						<th><?=gettext("Timeout AAAA")?></th>
66
						<th><?=gettext("Timeout Other")?></th>
67
					</tr>
68
				</thead>
69
				<tbody>
70
<?php if (empty($infra_cache_entries)): ?>
71
					<tr>
72
						<td colspan="10">
73
							<i><?= gettext("No Data") ?></i>
74
						</td>
75
					</tr>
76
<?php endif; ?>
77
<?php
78
foreach ($infra_cache_entries as $ice) {
79
	$line = explode(' ', $ice);
80
?>
81
					<tr>
82
						<td>
83
							<?=$line[0]?>
84
						</td>
85
						<td>
86
							<?=$line[1]?>
87
						</td>
88
<?php
89
	if ($line[3] == "expired"):
90
?>
91
						<td colspan="4">
92
							<?=$line[3]?>
93
						</td>
94
						<td>
95
							<?=$line[5]?>
96
						</td>
97
						<td colspan="4">
98
							&nbsp;
99
						</td>
100
<?php	else: ?>
101
						<td>
102
							<?=$line[3]?>
103
						</td>
104
						<td>
105
							<?=$line[5]?>
106
						</td>
107
						<td>
108
							<?=$line[7]?>
109
						</td>
110
						<td>
111
							<?=$line[9]?>
112
						</td>
113
						<td>
114
							<?=$line[11]?>
115
						</td>
116
						<td>
117
							<?=$line[13]?>
118
						</td>
119
						<td>
120
							<?=$line[15]?>
121
						</td>
122
						<td>
123
							<?=$line[17]?>
124
						</td>
125
					</tr>
126

    
127
<?php	endif;
128
}
129
?>
130
				</tbody>
131
			</table>
132
		</div>
133
	</div>
134
</div>
135

    
136
<div class="panel panel-default">
137
	<div class="panel-heading"><h2 class="panel-title"><?=gettext("DNS Resolver Infrastructure Cache Stats")?></h2></div>
138
	<div class="panel-body">
139
		<div class="table-responsive">
140
			<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
141
				<thead>
142
					<tr>
143
						<th><?=gettext("Server")?></th>
144
						<th><?=gettext("Zone")?></th>
145
						<th><?=gettext("eDNS Lame Known")?></th>
146
						<th><?=gettext("eDNS Version")?></th>
147
						<th><?=gettext("Probe Delay")?></th>
148
						<th><?=gettext("Lame DNSSEC")?></th>
149
						<th><?=gettext("Lame Rec")?></th>
150
						<th><?=gettext("Lame A")?></th>
151
						<th><?=gettext("Lame Other")?></th>
152
					</tr>
153
				</thead>
154
				<tbody>
155
<?php if (empty($infra_cache_entries)): ?>
156
					<tr>
157
						<td colspan="17">
158
							<i><?= gettext("No Data") ?></i>
159
						</td>
160
					</tr>
161
<?php endif; ?>
162
<?php
163
foreach ($infra_cache_entries as $ice) {
164
	$line = explode(' ', $ice);
165
?>
166
					<tr>
167
						<td>
168
							<?=$line[0]?>
169
						</td>
170
						<td>
171
							<?=$line[1]?>
172
						</td>
173
<?php
174
	if ($line[3] == "expired"):
175
?>
176
						<td colspan="7">
177
							<?=$line[3]?>
178
							&nbsp;
179
						</td>
180
<?php	else: ?>
181
						<td>
182
							<?=$line[19]?>
183
						</td>
184
						<td>
185
							<?=$line[21]?>
186
						</td>
187
						<td>
188
							<?=$line[23]?>
189
						</td>
190
						<td>
191
							<?=$line[26]?>
192
						</td>
193
						<td>
194
							<?=$line[28]?>
195
						</td>
196
						<td>
197
							<?=$line[30]?>
198
						</td>
199
						<td>
200
							<?=$line[32]?>
201
						</td>
202
					</tr>
203

    
204
<?php	endif;
205
}
206
?>
207
				</tbody>
208
			</table>
209
		</div>
210
	</div>
211
</div>
212

    
213
<?php
214
include("foot.inc");
(185-185/232)