1 |
5b237745
|
Scott Ullrich
|
<?php
|
2 |
b46bfcf5
|
Bill Marquette
|
/* $Id$ */
|
3 |
5b237745
|
Scott Ullrich
|
/*
|
4 |
|
|
services_snmp.php
|
5 |
|
|
part of m0n0wall (http://m0n0.ch/wall)
|
6 |
|
|
|
7 |
|
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
8 |
|
|
All rights reserved.
|
9 |
29aef6c4
|
Jim Thompson
|
|
10 |
|
|
part of pfSense
|
11 |
6317d31d
|
Phil Davis
|
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
|
12 |
29aef6c4
|
Jim Thompson
|
All rights reserved.
|
13 |
5b237745
|
Scott Ullrich
|
|
14 |
|
|
Redistribution and use in source and binary forms, with or without
|
15 |
|
|
modification, are permitted provided that the following conditions are met:
|
16 |
|
|
|
17 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
18 |
|
|
this list of conditions and the following disclaimer.
|
19 |
|
|
|
20 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
21 |
|
|
notice, this list of conditions and the following disclaimer in the
|
22 |
|
|
documentation and/or other materials provided with the distribution.
|
23 |
|
|
|
24 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
25 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
26 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
27 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
28 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
29 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
30 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
32 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
34 |
|
|
*/
|
35 |
1d333258
|
Scott Ullrich
|
/*
|
36 |
|
|
pfSense_MODULE: snmp
|
37 |
|
|
*/
|
38 |
5b237745
|
Scott Ullrich
|
|
39 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
40 |
|
|
##|*IDENT=page-services-snmp
|
41 |
|
|
##|*NAME=Services: SNMP page
|
42 |
|
|
##|*DESCR=Allow access to the 'Services: SNMP' page.
|
43 |
|
|
##|*MATCH=services_snmp.php*
|
44 |
|
|
##|-PRIV
|
45 |
|
|
|
46 |
5b237745
|
Scott Ullrich
|
require("guiconfig.inc");
|
47 |
4e865673
|
Carlos Eduardo Ramos
|
require_once("functions.inc");
|
48 |
5b237745
|
Scott Ullrich
|
|
49 |
|
|
if (!is_array($config['snmpd'])) {
|
50 |
|
|
$config['snmpd'] = array();
|
51 |
|
|
$config['snmpd']['rocommunity'] = "public";
|
52 |
3805bfdd
|
John Fleming
|
$config['snmpd']['pollport'] = "161";
|
53 |
5b237745
|
Scott Ullrich
|
}
|
54 |
|
|
|
55 |
3805bfdd
|
John Fleming
|
if (!is_array($config['snmpd']['modules'])) {
|
56 |
|
|
$config['snmpd']['modules'] = array();
|
57 |
|
|
$config['snmpd']['modules']['mibii'] = true;
|
58 |
|
|
$config['snmpd']['modules']['netgraph'] = true;
|
59 |
|
|
$config['snmpd']['modules']['pf'] = true;
|
60 |
95fb49e8
|
Seth Mos
|
$config['snmpd']['modules']['hostres'] = true;
|
61 |
|
|
$config['snmpd']['modules']['bridge'] = true;
|
62 |
671914b2
|
jim-p
|
$config['snmpd']['modules']['ucd'] = true;
|
63 |
|
|
$config['snmpd']['modules']['regex'] = true;
|
64 |
3805bfdd
|
John Fleming
|
}
|
65 |
4f4d63d8
|
John Fleming
|
$pconfig['enable'] = isset($config['snmpd']['enable']);
|
66 |
3805bfdd
|
John Fleming
|
$pconfig['pollport'] = $config['snmpd']['pollport'];
|
67 |
5b237745
|
Scott Ullrich
|
$pconfig['syslocation'] = $config['snmpd']['syslocation'];
|
68 |
|
|
$pconfig['syscontact'] = $config['snmpd']['syscontact'];
|
69 |
|
|
$pconfig['rocommunity'] = $config['snmpd']['rocommunity'];
|
70 |
4f4d63d8
|
John Fleming
|
/* disabled until some docs show up on what this does.
|
71 |
|
|
$pconfig['rwenable'] = isset($config['snmpd']['rwenable']);
|
72 |
|
|
$pconfig['rwcommunity'] = $config['snmpd']['rwcommunity'];
|
73 |
|
|
*/
|
74 |
|
|
$pconfig['trapenable'] = isset($config['snmpd']['trapenable']);
|
75 |
|
|
$pconfig['trapserver'] = $config['snmpd']['trapserver'];
|
76 |
|
|
$pconfig['trapserverport'] = $config['snmpd']['trapserverport'];
|
77 |
8c3c9dc2
|
John Fleming
|
$pconfig['trapstring'] = $config['snmpd']['trapstring'];
|
78 |
5b237745
|
Scott Ullrich
|
|
79 |
3805bfdd
|
John Fleming
|
$pconfig['mibii'] = isset($config['snmpd']['modules']['mibii']);
|
80 |
|
|
$pconfig['netgraph'] = isset($config['snmpd']['modules']['netgraph']);
|
81 |
|
|
$pconfig['pf'] = isset($config['snmpd']['modules']['pf']);
|
82 |
95fb49e8
|
Seth Mos
|
$pconfig['hostres'] = isset($config['snmpd']['modules']['hostres']);
|
83 |
|
|
$pconfig['bridge'] = isset($config['snmpd']['modules']['bridge']);
|
84 |
671914b2
|
jim-p
|
$pconfig['ucd'] = isset($config['snmpd']['modules']['ucd']);
|
85 |
|
|
$pconfig['regex'] = isset($config['snmpd']['modules']['regex']);
|
86 |
3d594a3f
|
jim-p
|
$pconfig['bindip'] = $config['snmpd']['bindip'];
|
87 |
3805bfdd
|
John Fleming
|
|
88 |
5b237745
|
Scott Ullrich
|
if ($_POST) {
|
89 |
|
|
|
90 |
|
|
unset($input_errors);
|
91 |
|
|
$pconfig = $_POST;
|
92 |
|
|
|
93 |
|
|
/* input validation */
|
94 |
|
|
if ($_POST['enable']) {
|
95 |
00686fee
|
pierrepomes
|
if (strstr($_POST['syslocation'],"#")) $input_errors[] = gettext("Invalid character '#' in system location");
|
96 |
|
|
if (strstr($_POST['syscontact'],"#")) $input_errors[] = gettext("Invalid character '#' in system contact");
|
97 |
|
|
if (strstr($_POST['rocommunity'],"#")) $input_errors[] = gettext("Invalid character '#' in read community string");
|
98 |
|
|
|
99 |
5b237745
|
Scott Ullrich
|
$reqdfields = explode(" ", "rocommunity");
|
100 |
3d9bee96
|
Rafael Lucas
|
$reqdfieldsn = array(gettext("Community"));
|
101 |
1e9b4611
|
Renato Botelho
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
102 |
3805bfdd
|
John Fleming
|
|
103 |
|
|
$reqdfields = explode(" ", "pollport");
|
104 |
3d9bee96
|
Rafael Lucas
|
$reqdfieldsn = array(gettext("Polling Port"));
|
105 |
1e9b4611
|
Renato Botelho
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
106 |
a42bf8cd
|
Scott Ullrich
|
|
107 |
72b5583c
|
Scott Ullrich
|
|
108 |
5b237745
|
Scott Ullrich
|
}
|
109 |
|
|
|
110 |
4f4d63d8
|
John Fleming
|
if ($_POST['trapenable']) {
|
111 |
00686fee
|
pierrepomes
|
if (strstr($_POST['trapstring'],"#")) $input_errors[] = gettext("Invalid character '#' in SNMP trap string");
|
112 |
|
|
|
113 |
4f4d63d8
|
John Fleming
|
$reqdfields = explode(" ", "trapserver");
|
114 |
3d9bee96
|
Rafael Lucas
|
$reqdfieldsn = array(gettext("Trap server"));
|
115 |
1e9b4611
|
Renato Botelho
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
116 |
3805bfdd
|
John Fleming
|
|
117 |
4f4d63d8
|
John Fleming
|
$reqdfields = explode(" ", "trapserverport");
|
118 |
3d9bee96
|
Rafael Lucas
|
$reqdfieldsn = array(gettext("Trap server port"));
|
119 |
1e9b4611
|
Renato Botelho
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
120 |
3805bfdd
|
John Fleming
|
|
121 |
8c3c9dc2
|
John Fleming
|
$reqdfields = explode(" ", "trapstring");
|
122 |
3d9bee96
|
Rafael Lucas
|
$reqdfieldsn = array(gettext("Trap string"));
|
123 |
1e9b4611
|
Renato Botelho
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
124 |
4f4d63d8
|
John Fleming
|
}
|
125 |
|
|
|
126 |
8c3c9dc2
|
John Fleming
|
|
127 |
4f4d63d8
|
John Fleming
|
/* disabled until some docs show up on what this does.
|
128 |
|
|
if ($_POST['rwenable']) {
|
129 |
|
|
$reqdfields = explode(" ", "rwcommunity");
|
130 |
|
|
$reqdfieldsn = explode(",", "Write community string");
|
131 |
1e9b4611
|
Renato Botelho
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
132 |
4f4d63d8
|
John Fleming
|
}
|
133 |
|
|
*/
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
5b237745
|
Scott Ullrich
|
if (!$input_errors) {
|
138 |
4f4d63d8
|
John Fleming
|
$config['snmpd']['enable'] = $_POST['enable'] ? true : false;
|
139 |
3805bfdd
|
John Fleming
|
$config['snmpd']['pollport'] = $_POST['pollport'];
|
140 |
3184f4e7
|
Scott Ullrich
|
$config['snmpd']['syslocation'] = $_POST['syslocation'];
|
141 |
5b237745
|
Scott Ullrich
|
$config['snmpd']['syscontact'] = $_POST['syscontact'];
|
142 |
|
|
$config['snmpd']['rocommunity'] = $_POST['rocommunity'];
|
143 |
4f4d63d8
|
John Fleming
|
/* disabled until some docs show up on what this does.
|
144 |
|
|
$config['snmpd']['rwenable'] = $_POST['rwenable'] ? true : false;
|
145 |
|
|
$config['snmpd']['rwcommunity'] = $_POST['rwcommunity'];
|
146 |
|
|
*/
|
147 |
|
|
$config['snmpd']['trapenable'] = $_POST['trapenable'] ? true : false;
|
148 |
|
|
$config['snmpd']['trapserver'] = $_POST['trapserver'];
|
149 |
|
|
$config['snmpd']['trapserverport'] = $_POST['trapserverport'];
|
150 |
8c3c9dc2
|
John Fleming
|
$config['snmpd']['trapstring'] = $_POST['trapstring'];
|
151 |
4f4d63d8
|
John Fleming
|
|
152 |
3805bfdd
|
John Fleming
|
$config['snmpd']['modules']['mibii'] = $_POST['mibii'] ? true : false;
|
153 |
|
|
$config['snmpd']['modules']['netgraph'] = $_POST['netgraph'] ? true : false;
|
154 |
|
|
$config['snmpd']['modules']['pf'] = $_POST['pf'] ? true : false;
|
155 |
95fb49e8
|
Seth Mos
|
$config['snmpd']['modules']['hostres'] = $_POST['hostres'] ? true : false;
|
156 |
|
|
$config['snmpd']['modules']['bridge'] = $_POST['bridge'] ? true : false;
|
157 |
671914b2
|
jim-p
|
$config['snmpd']['modules']['ucd'] = $_POST['ucd'] ? true : false;
|
158 |
|
|
$config['snmpd']['modules']['regex'] = $_POST['regex'] ? true : false;
|
159 |
c82b2c3f
|
jim-p
|
$config['snmpd']['bindip'] = $_POST['bindip'];
|
160 |
5b237745
|
Scott Ullrich
|
|
161 |
|
|
write_config();
|
162 |
|
|
|
163 |
|
|
$retval = 0;
|
164 |
920b3bb0
|
Scott Ullrich
|
$retval = services_snmpd_configure();
|
165 |
5b237745
|
Scott Ullrich
|
$savemsg = get_std_save_message($retval);
|
166 |
|
|
}
|
167 |
|
|
}
|
168 |
4df96eff
|
Scott Ullrich
|
|
169 |
a50337c3
|
Colin Fleming
|
$closehead = false;
|
170 |
3d9bee96
|
Rafael Lucas
|
$pgtitle = array(gettext("Services"),gettext("SNMP"));
|
171 |
d71fc5d3
|
jim-p
|
$shortcut_section = "snmp";
|
172 |
4df96eff
|
Scott Ullrich
|
include("head.inc");
|
173 |
|
|
|
174 |
5b237745
|
Scott Ullrich
|
?>
|
175 |
91f026b0
|
ayvis
|
<script type="text/javascript">
|
176 |
a50337c3
|
Colin Fleming
|
//<![CDATA[
|
177 |
7bc5c543
|
jim-p
|
function check_deps() {
|
178 |
ea1cea05
|
Vinicius Coque
|
if (jQuery('#hostres').prop('checked') == true) {
|
179 |
|
|
jQuery('#mibii').prop('checked',true);
|
180 |
7bc5c543
|
jim-p
|
}
|
181 |
|
|
}
|
182 |
|
|
|
183 |
4f4d63d8
|
John Fleming
|
function enable_change(whichone) {
|
184 |
|
|
|
185 |
|
|
if( whichone.name == "trapenable" )
|
186 |
|
|
{
|
187 |
|
|
if( whichone.checked == true )
|
188 |
|
|
{
|
189 |
|
|
document.iform.trapserver.disabled = false;
|
190 |
|
|
document.iform.trapserverport.disabled = false;
|
191 |
8c3c9dc2
|
John Fleming
|
document.iform.trapstring.disabled = false;
|
192 |
4f4d63d8
|
John Fleming
|
}
|
193 |
|
|
else
|
194 |
|
|
{
|
195 |
|
|
document.iform.trapserver.disabled = true;
|
196 |
|
|
document.iform.trapserverport.disabled = true;
|
197 |
8c3c9dc2
|
John Fleming
|
document.iform.trapstring.disabled = true;
|
198 |
4f4d63d8
|
John Fleming
|
}
|
199 |
|
|
}
|
200 |
|
|
|
201 |
|
|
/* disabled until some docs show up on what this does.
|
202 |
|
|
if( whichone.name == "rwenable" )
|
203 |
|
|
{
|
204 |
|
|
if( whichone.checked == true )
|
205 |
|
|
{
|
206 |
|
|
document.iform.rwcommunity.disabled = false;
|
207 |
|
|
}
|
208 |
|
|
else
|
209 |
|
|
{
|
210 |
|
|
document.iform.rwcommunity.disabled = true;
|
211 |
|
|
}
|
212 |
|
|
}
|
213 |
|
|
*/
|
214 |
|
|
|
215 |
|
|
if( document.iform.enable.checked == true )
|
216 |
|
|
{
|
217 |
3805bfdd
|
John Fleming
|
document.iform.pollport.disabled = false;
|
218 |
4f4d63d8
|
John Fleming
|
document.iform.syslocation.disabled = false;
|
219 |
|
|
document.iform.syscontact.disabled = false;
|
220 |
|
|
document.iform.rocommunity.disabled = false;
|
221 |
|
|
document.iform.trapenable.disabled = false;
|
222 |
|
|
/* disabled until some docs show up on what this does.
|
223 |
|
|
document.iform.rwenable.disabled = false;
|
224 |
|
|
if( document.iform.rwenable.checked == true )
|
225 |
|
|
{
|
226 |
|
|
document.iform.rwcommunity.disabled = false;
|
227 |
|
|
}
|
228 |
|
|
else
|
229 |
|
|
{
|
230 |
|
|
document.iform.rwcommunity.disabled = true;
|
231 |
|
|
}
|
232 |
|
|
*/
|
233 |
|
|
if( document.iform.trapenable.checked == true )
|
234 |
|
|
{
|
235 |
|
|
document.iform.trapserver.disabled = false;
|
236 |
|
|
document.iform.trapserverport.disabled = false;
|
237 |
8c3c9dc2
|
John Fleming
|
document.iform.trapstring.disabled = false;
|
238 |
4f4d63d8
|
John Fleming
|
}
|
239 |
|
|
else
|
240 |
|
|
{
|
241 |
|
|
document.iform.trapserver.disabled = true;
|
242 |
a21b1cad
|
John Fleming
|
document.iform.trapserverport.disabled = true;
|
243 |
8c3c9dc2
|
John Fleming
|
document.iform.trapstring.disabled = true;
|
244 |
4f4d63d8
|
John Fleming
|
}
|
245 |
3805bfdd
|
John Fleming
|
document.iform.mibii.disabled = false;
|
246 |
|
|
document.iform.netgraph.disabled = false;
|
247 |
|
|
document.iform.pf.disabled = false;
|
248 |
95fb49e8
|
Seth Mos
|
document.iform.hostres.disabled = false;
|
249 |
671914b2
|
jim-p
|
document.iform.ucd.disabled = false;
|
250 |
|
|
document.iform.regex.disabled = false;
|
251 |
0bbf8900
|
Ermal
|
//document.iform.bridge.disabled = false;
|
252 |
4f4d63d8
|
John Fleming
|
}
|
253 |
|
|
else
|
254 |
|
|
{
|
255 |
3805bfdd
|
John Fleming
|
document.iform.pollport.disabled = true;
|
256 |
4f4d63d8
|
John Fleming
|
document.iform.syslocation.disabled = true;
|
257 |
|
|
document.iform.syscontact.disabled = true;
|
258 |
|
|
document.iform.rocommunity.disabled = true;
|
259 |
|
|
/*
|
260 |
|
|
document.iform.rwenable.disabled = true;
|
261 |
|
|
document.iform.rwcommunity.disabled = true;
|
262 |
|
|
*/
|
263 |
|
|
document.iform.trapenable.disabled = true;
|
264 |
|
|
document.iform.trapserver.disabled = true;
|
265 |
|
|
document.iform.trapserverport.disabled = true;
|
266 |
8c3c9dc2
|
John Fleming
|
document.iform.trapstring.disabled = true;
|
267 |
3805bfdd
|
John Fleming
|
|
268 |
|
|
document.iform.mibii.disabled = true;
|
269 |
|
|
document.iform.netgraph.disabled = true;
|
270 |
|
|
document.iform.pf.disabled = true;
|
271 |
95fb49e8
|
Seth Mos
|
document.iform.hostres.disabled = true;
|
272 |
671914b2
|
jim-p
|
document.iform.ucd.disabled = true;
|
273 |
|
|
document.iform.regex.disabled = true;
|
274 |
0bbf8900
|
Ermal
|
//document.iform.bridge.disabled = true;
|
275 |
4f4d63d8
|
John Fleming
|
}
|
276 |
5b237745
|
Scott Ullrich
|
}
|
277 |
a50337c3
|
Colin Fleming
|
//]]>
|
278 |
5b237745
|
Scott Ullrich
|
</script>
|
279 |
a50337c3
|
Colin Fleming
|
</head>
|
280 |
5b237745
|
Scott Ullrich
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
281 |
|
|
<?php include("fbegin.inc"); ?>
|
282 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
283 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
284 |
|
|
<form action="services_snmp.php" method="post" name="iform" id="iform">
|
285 |
a50337c3
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="snmp">
|
286 |
4f4d63d8
|
John Fleming
|
|
287 |
5b237745
|
Scott Ullrich
|
<tr>
|
288 |
4f4d63d8
|
John Fleming
|
<td colspan="2" valign="top" class="optsect_t">
|
289 |
a50337c3
|
Colin Fleming
|
<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
|
290 |
3d9bee96
|
Rafael Lucas
|
<tr><td class="optsect_s"><strong><?=gettext("SNMP Daemon");?></strong></td>
|
291 |
a50337c3
|
Colin Fleming
|
<td align="right" class="optsect_s"><input name="enable" id="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(this)" /> <strong><?=gettext("Enable");?></strong></td></tr>
|
292 |
4f4d63d8
|
John Fleming
|
</table></td>
|
293 |
5b237745
|
Scott Ullrich
|
</tr>
|
294 |
3805bfdd
|
John Fleming
|
|
295 |
|
|
<tr>
|
296 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Polling Port ");?></td>
|
297 |
3805bfdd
|
John Fleming
|
<td width="78%" class="vtable">
|
298 |
a50337c3
|
Colin Fleming
|
<input name="pollport" type="text" class="formfld unknown" id="pollport" size="40" value="<?=htmlspecialchars($pconfig['pollport']) ? htmlspecialchars($pconfig['pollport']) : htmlspecialchars(161);?>" />
|
299 |
8cd558b6
|
ayvis
|
<br /><?=gettext("Enter the port to accept polling events on (default 161)");?><br />
|
300 |
3805bfdd
|
John Fleming
|
</td>
|
301 |
|
|
</tr>
|
302 |
|
|
|
303 |
5b237745
|
Scott Ullrich
|
<tr>
|
304 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncell"><?=gettext("System location");?></td>
|
305 |
5b237745
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
306 |
a50337c3
|
Colin Fleming
|
<input name="syslocation" type="text" class="formfld unknown" id="syslocation" size="40" value="<?=htmlspecialchars($pconfig['syslocation']);?>" />
|
307 |
5b237745
|
Scott Ullrich
|
</td>
|
308 |
|
|
</tr>
|
309 |
3805bfdd
|
John Fleming
|
|
310 |
5b237745
|
Scott Ullrich
|
<tr>
|
311 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncell"><?=gettext("System contact");?></td>
|
312 |
5b237745
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
313 |
a50337c3
|
Colin Fleming
|
<input name="syscontact" type="text" class="formfld unknown" id="syscontact" size="40" value="<?=htmlspecialchars($pconfig['syscontact']);?>" />
|
314 |
5b237745
|
Scott Ullrich
|
</td>
|
315 |
|
|
</tr>
|
316 |
3805bfdd
|
John Fleming
|
|
317 |
5b237745
|
Scott Ullrich
|
<tr>
|
318 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Read Community String");?></td>
|
319 |
5b237745
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
320 |
a50337c3
|
Colin Fleming
|
<input name="rocommunity" type="text" class="formfld unknown" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>" />
|
321 |
8cd558b6
|
ayvis
|
<br /><?=gettext("The community string is like a password, restricting access to querying SNMP to hosts knowing the community string. Use a strong value here to protect from unauthorized information disclosure.");?><br />
|
322 |
3805bfdd
|
John Fleming
|
</td>
|
323 |
5b237745
|
Scott Ullrich
|
</tr>
|
324 |
4f4d63d8
|
John Fleming
|
|
325 |
|
|
<?php
|
326 |
|
|
/* disabled until some docs show up on what this does.
|
327 |
|
|
<tr>
|
328 |
|
|
<td width="22%" valign="top" class="vtable"> </td>
|
329 |
|
|
<td width="78%" class="vtable">
|
330 |
a50337c3
|
Colin Fleming
|
<input name="rwenable" id="rwenable" type="checkbox" value="yes" <?php if ($pconfig['rwenable']) echo "checked=\"checked\""; ?> onclick="enable_change(this)" />
|
331 |
3805bfdd
|
John Fleming
|
<strong>Enable Write Community String</strong>
|
332 |
|
|
</td>
|
333 |
4f4d63d8
|
John Fleming
|
</tr>
|
334 |
|
|
|
335 |
|
|
<tr>
|
336 |
|
|
<td width="22%" valign="top" class="vncellreq">Write community string</td>
|
337 |
|
|
<td width="78%" class="vtable">
|
338 |
a50337c3
|
Colin Fleming
|
<input name="rwcommunity" type="text" class="formfld unknown" id="rwcommunity" size="40" value="<?=htmlspecialchars($pconfig['rwcommunity']);?>" />
|
339 |
8cd558b6
|
ayvis
|
<br />Please use something other then "private" here<br />
|
340 |
3805bfdd
|
John Fleming
|
</td>
|
341 |
4f4d63d8
|
John Fleming
|
</tr>
|
342 |
|
|
*/
|
343 |
|
|
?>
|
344 |
|
|
|
345 |
3184f4e7
|
Scott Ullrich
|
<tr><td> </td></tr>
|
346 |
|
|
|
347 |
|
|
<tr>
|
348 |
|
|
<td colspan="2" valign="top" class="optsect_t">
|
349 |
a50337c3
|
Colin Fleming
|
<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
|
350 |
3d9bee96
|
Rafael Lucas
|
<tr><td class="optsect_s"><strong><?=gettext("SNMP Traps");?></strong></td>
|
351 |
a50337c3
|
Colin Fleming
|
<td align="right" class="optsect_s"><input name="trapenable" id="trapenable" type="checkbox" value="yes" <?php if ($pconfig['trapenable']) echo "checked=\"checked\""; ?> onclick="enable_change(this)" /> <strong><?=gettext("Enable");?></strong></td></tr>
|
352 |
3184f4e7
|
Scott Ullrich
|
</table></td>
|
353 |
|
|
</tr>
|
354 |
|
|
|
355 |
|
|
|
356 |
4f4d63d8
|
John Fleming
|
<tr>
|
357 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server");?></td>
|
358 |
4f4d63d8
|
John Fleming
|
<td width="78%" class="vtable">
|
359 |
a50337c3
|
Colin Fleming
|
<input name="trapserver" type="text" class="formfld unknown" id="trapserver" size="40" value="<?=htmlspecialchars($pconfig['trapserver']);?>" />
|
360 |
8cd558b6
|
ayvis
|
<br /><?=gettext("Enter trap server name");?><br />
|
361 |
3805bfdd
|
John Fleming
|
</td>
|
362 |
4f4d63d8
|
John Fleming
|
</tr>
|
363 |
|
|
|
364 |
|
|
<tr>
|
365 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server port ");?></td>
|
366 |
4f4d63d8
|
John Fleming
|
<td width="78%" class="vtable">
|
367 |
a50337c3
|
Colin Fleming
|
<input name="trapserverport" type="text" class="formfld unknown" id="trapserverport" size="40" value="<?=htmlspecialchars($pconfig['trapserverport']) ? htmlspecialchars($pconfig['trapserverport']) : htmlspecialchars(162);?>" />
|
368 |
8cd558b6
|
ayvis
|
<br /><?=gettext("Enter the port to send the traps to (default 162)");?><br />
|
369 |
3805bfdd
|
John Fleming
|
</td>
|
370 |
4f4d63d8
|
John Fleming
|
</tr>
|
371 |
3805bfdd
|
John Fleming
|
|
372 |
8c3c9dc2
|
John Fleming
|
<tr>
|
373 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Enter the SNMP trap string");?></td>
|
374 |
8c3c9dc2
|
John Fleming
|
<td width="78%" class="vtable">
|
375 |
a50337c3
|
Colin Fleming
|
<input name="trapstring" type="text" class="formfld unknown" id="trapstring" size="40" value="<?=htmlspecialchars($pconfig['trapstring']);?>" />
|
376 |
8cd558b6
|
ayvis
|
<br /><?=gettext("Trap string");?><br />
|
377 |
3805bfdd
|
John Fleming
|
</td>
|
378 |
8c3c9dc2
|
John Fleming
|
</tr>
|
379 |
|
|
|
380 |
ba73e2a3
|
Scott Ullrich
|
<tr><td> </td></tr>
|
381 |
|
|
|
382 |
|
|
<tr>
|
383 |
|
|
<td colspan="2" valign="top" class="optsect_t">
|
384 |
a50337c3
|
Colin Fleming
|
<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="modules">
|
385 |
3d9bee96
|
Rafael Lucas
|
<tr><td class="optsect_s"><strong><?=gettext("Modules");?></strong></td>
|
386 |
ba73e2a3
|
Scott Ullrich
|
<td align="right" class="optsect_s"> </td></tr>
|
387 |
|
|
</table></td>
|
388 |
|
|
</tr>
|
389 |
|
|
|
390 |
3805bfdd
|
John Fleming
|
<tr>
|
391 |
3d9bee96
|
Rafael Lucas
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("SNMP Modules");?></td>
|
392 |
3805bfdd
|
John Fleming
|
<td width="78%" class="vtable">
|
393 |
a50337c3
|
Colin Fleming
|
<input name="mibii" type="checkbox" id="mibii" value="yes" onclick="check_deps()" <?php if ($pconfig['mibii']) echo "checked=\"checked\""; ?> /><?=gettext("MibII"); ?>
|
394 |
95fb49e8
|
Seth Mos
|
<br />
|
395 |
a50337c3
|
Colin Fleming
|
<input name="netgraph" type="checkbox" id="netgraph" value="yes" <?php if ($pconfig['netgraph']) echo "checked=\"checked\""; ?> /><?=gettext("Netgraph"); ?>
|
396 |
95fb49e8
|
Seth Mos
|
<br />
|
397 |
a50337c3
|
Colin Fleming
|
<input name="pf" type="checkbox" id="pf" value="yes" <?php if ($pconfig['pf']) echo "checked=\"checked\""; ?> /><?=gettext("PF"); ?>
|
398 |
95fb49e8
|
Seth Mos
|
<br />
|
399 |
a50337c3
|
Colin Fleming
|
<input name="hostres" type="checkbox" id="hostres" value="yes" onclick="check_deps()" <?php if ($pconfig['hostres']) echo "checked=\"checked\""; ?> /><?=gettext("Host Resources (Requires MibII)");?>
|
400 |
671914b2
|
jim-p
|
<br />
|
401 |
a50337c3
|
Colin Fleming
|
<input name="ucd" type="checkbox" id="ucd" value="yes" <?php if ($pconfig['ucd']) echo "checked=\"checked\""; ?> /><?=gettext("UCD"); ?>
|
402 |
671914b2
|
jim-p
|
<br />
|
403 |
a50337c3
|
Colin Fleming
|
<input name="regex" type="checkbox" id="regex" value="yes" <?php if ($pconfig['regex']) echo "checked=\"checked\""; ?> /><?=gettext("Regex"); ?>
|
404 |
671914b2
|
jim-p
|
<br />
|
405 |
3805bfdd
|
John Fleming
|
</td>
|
406 |
|
|
</tr>
|
407 |
c82b2c3f
|
jim-p
|
|
408 |
|
|
<tr><td> </td></tr>
|
409 |
|
|
|
410 |
|
|
<tr>
|
411 |
|
|
<td colspan="2" valign="top" class="optsect_t">
|
412 |
a50337c3
|
Colin Fleming
|
<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="interface">
|
413 |
c82b2c3f
|
jim-p
|
<tr><td class="optsect_s"><strong><?=gettext("Interface Binding");?></strong></td>
|
414 |
|
|
<td align="right" class="optsect_s"> </td></tr>
|
415 |
|
|
</table></td>
|
416 |
|
|
</tr>
|
417 |
|
|
<tr>
|
418 |
|
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Bind Interface"); ?></td>
|
419 |
|
|
<td width="78%" class="vtable">
|
420 |
|
|
<select name="bindip" class="formselect">
|
421 |
|
|
<option value="">All</option>
|
422 |
|
|
<?php $listenips = get_possible_listen_ips();
|
423 |
|
|
foreach ($listenips as $lip):
|
424 |
|
|
$selected = "";
|
425 |
|
|
if ($lip['value'] == $pconfig['bindip'])
|
426 |
a50337c3
|
Colin Fleming
|
$selected = "selected=\"selected\"";
|
427 |
c82b2c3f
|
jim-p
|
?>
|
428 |
|
|
<option value="<?=$lip['value'];?>" <?=$selected;?>>
|
429 |
|
|
<?=htmlspecialchars($lip['name']);?>
|
430 |
|
|
</option>
|
431 |
|
|
<?php endforeach; ?>
|
432 |
a50337c3
|
Colin Fleming
|
</select>
|
433 |
|
|
</td>
|
434 |
c82b2c3f
|
jim-p
|
</tr>
|
435 |
612bb4f3
|
Scott Ullrich
|
<tr>
|
436 |
|
|
<td width="22%" valign="top"> </td>
|
437 |
|
|
<td width="78%">
|
438 |
a50337c3
|
Colin Fleming
|
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
|
439 |
612bb4f3
|
Scott Ullrich
|
</td>
|
440 |
|
|
</tr>
|
441 |
|
|
</table>
|
442 |
5b237745
|
Scott Ullrich
|
</form>
|
443 |
91f026b0
|
ayvis
|
<script type="text/javascript">
|
444 |
a50337c3
|
Colin Fleming
|
//<![CDATA[
|
445 |
4f4d63d8
|
John Fleming
|
enable_change(this);
|
446 |
a50337c3
|
Colin Fleming
|
//]]>
|
447 |
5b237745
|
Scott Ullrich
|
</script>
|
448 |
|
|
<?php include("fend.inc"); ?>
|
449 |
|
|
</body>
|
450 |
|
|
</html>
|