. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ require("guiconfig.inc"); if (!is_array($config['snmpd'])) { $config['snmpd'] = array(); $config['snmpd']['rocommunity'] = "public"; $config['snmpd']['pollport'] = "161"; } if (!is_array($config['snmpd']['modules'])) { $config['snmpd']['modules'] = array(); $config['snmpd']['modules']['mibii'] = true; $config['snmpd']['modules']['netgraph'] = true; $config['snmpd']['modules']['pf'] = true; $config['snmpd']['modules']['hostres'] = true; $config['snmpd']['modules']['bridge'] = true; } $pconfig['enable'] = isset($config['snmpd']['enable']); $pconfig['pollport'] = $config['snmpd']['pollport']; $pconfig['syslocation'] = $config['snmpd']['syslocation']; $pconfig['syscontact'] = $config['snmpd']['syscontact']; $pconfig['rocommunity'] = $config['snmpd']['rocommunity']; /* disabled until some docs show up on what this does. $pconfig['rwenable'] = isset($config['snmpd']['rwenable']); $pconfig['rwcommunity'] = $config['snmpd']['rwcommunity']; */ $pconfig['trapenable'] = isset($config['snmpd']['trapenable']); $pconfig['trapserver'] = $config['snmpd']['trapserver']; $pconfig['trapserverport'] = $config['snmpd']['trapserverport']; $pconfig['trapstring'] = $config['snmpd']['trapstring']; $pconfig['mibii'] = isset($config['snmpd']['modules']['mibii']); $pconfig['netgraph'] = isset($config['snmpd']['modules']['netgraph']); $pconfig['pf'] = isset($config['snmpd']['modules']['pf']); $pconfig['hostres'] = isset($config['snmpd']['modules']['hostres']); $pconfig['bridge'] = isset($config['snmpd']['modules']['bridge']); $pconfig['bindlan'] = isset($config['snmpd']['bindlan']); if ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation */ if ($_POST['enable']) { $reqdfields = explode(" ", "rocommunity"); $reqdfieldsn = explode(",", "Community"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); $reqdfields = explode(" ", "pollport"); $reqdfieldsn = explode(",", "Polling Port"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); } if ($_POST['trapenable']) { $reqdfields = explode(" ", "trapserver"); $reqdfieldsn = explode(",", "Trap server"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); $reqdfields = explode(" ", "trapserverport"); $reqdfieldsn = explode(",", "Trap server port"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); $reqdfields = explode(" ", "trapstring"); $reqdfieldsn = explode(",", "Trap string"); do_input_validation($_POST, $reqdfields, $reqdfields, $reqdfieldsn, &$input_errors); } /* disabled until some docs show up on what this does. if ($_POST['rwenable']) { $reqdfields = explode(" ", "rwcommunity"); $reqdfieldsn = explode(",", "Write community string"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); } */ if (!$input_errors) { $config['snmpd']['enable'] = $_POST['enable'] ? true : false; $config['snmpd']['pollport'] = $_POST['pollport']; $config['snmpd']['syslocation'] = $_POST['syslocation']; $config['snmpd']['syscontact'] = $_POST['syscontact']; $config['snmpd']['rocommunity'] = $_POST['rocommunity']; /* disabled until some docs show up on what this does. $config['snmpd']['rwenable'] = $_POST['rwenable'] ? true : false; $config['snmpd']['rwcommunity'] = $_POST['rwcommunity']; */ $config['snmpd']['trapenable'] = $_POST['trapenable'] ? true : false; $config['snmpd']['trapserver'] = $_POST['trapserver']; $config['snmpd']['trapserverport'] = $_POST['trapserverport']; $config['snmpd']['trapstring'] = $_POST['trapstring']; $config['snmpd']['modules']['mibii'] = $_POST['mibii'] ? true : false; $config['snmpd']['modules']['netgraph'] = $_POST['netgraph'] ? true : false; $config['snmpd']['modules']['pf'] = $_POST['pf'] ? true : false; $config['snmpd']['modules']['hostres'] = $_POST['hostres'] ? true : false; $config['snmpd']['modules']['bridge'] = $_POST['bridge'] ? true : false; $config['snmpd']['bindlan'] = $_POST['bindlan'] ? true : false; write_config(); $retval = 0; config_lock(); $retval = services_snmpd_configure(); config_unlock(); $savemsg = get_std_save_message($retval); } } $pgtitle = "Services: SNMP"; include("head.inc"); ?>

*/ ?>
SNMP Daemon onClick="enable_change(this)"> Enable
Polling Port
Enter the port to accept polling events on (default 161)
System location
System contact
Read Community String
In most cases, "public" is used here
  onClick="enable_change(this)"> Enable Write Community String
Write community string
Please use something other then "private" here
 
SNMP Traps onClick="enable_change(this)"> Enable
Trap server
Enter trap server name
Trap server port
Enter the port to send the traps to (default 162)
Enter the SNMP trap string
Trap string
 
Modules  
SNMP Modules >MibII
>Netgraph
>PF
>Host Resources
> Bind to LAN interface only
This option can be useful when trying to access the SNMP agent by the LAN interface's IP address through a VPN tunnel terminated on the WAN interface.