$ldescr) { $iplist[$lip] = $ldescr; } unset($listenips); return($iplist); } $closehead = false; $pgtitle = array(gettext("Services"), gettext("SNMP")); $shortcut_section = "snmp"; include("head.inc"); if ($input_errors) print_input_errors($input_errors); if ($savemsg) print_info_box($savemsg); $form = new Form(); $section = new Form_Section('SNMP Daemon'); $section->addInput(new Form_Checkbox( 'enable', 'Enable', 'Enable the SNMP Daemon and its controls', $pconfig['enable'] )); $form->add($section); $section = new Form_Section('SNMP Daemon settings'); $section->addInput(new Form_Input( 'pollport', 'Polling Port', 'text', ($pconfig['pollport'] ? $pconfig['pollport']:'161') ))->setHelp('Enter the port to accept polling events on (default 161)'); $section->addInput(new Form_Input( 'syslocation', 'System Location', 'text', $pconfig['syslocation'] )); $section->addInput(new Form_Input( 'syscontact', 'System Contact', 'text', $pconfig['syscontact'] )); $section->addInput(new Form_Input( 'rocommunity', 'Read Community String', 'text', $pconfig['rocommunity'] ))->setHelp('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.'); $form->add($section); $section = new Form_Section('SNMP Traps Enable'); $section->addInput(new Form_Checkbox( 'trapenable', 'Enable', 'Enable the SNMP Trap and its controls', $pconfig['trapenable'] ))->toggles('.toggle-traps'); $form->add($section); $section = new Form_Section('SNMP Trap settings'); if($pconfig['trapenable']) $section->addClass('toggle-traps', 'in'); else $section->addClass('toggle-traps', 'collapse'); $section->addInput(new Form_Input( 'trapserver', 'Trap server', 'text', $pconfig['trapserver'] ))->setHelp('Enter the trap server name'); $section->addInput(new Form_Input( 'trapserverport', 'Trap Server Port', 'text', ($pconfig['trapserverport'] ? $pconfig['trapserverport']:'162') ))->setHelp('Enter the port to send the traps to (default 162)'); $section->addInput(new Form_Input( 'trapstring', 'SNMP Trap String', 'text', $pconfig['trapstring'] )); $form->add($section); $section = new Form_Section('SNMP Modules'); $group = new Form_MultiCheckboxGroup('SNMP modules'); $group->add(new Form_MultiCheckbox( 'mibii', null, 'MibII', $pconfig['mibii'] )); $group->add(new Form_MultiCheckbox( 'netgraph', null, 'Netgraph', $pconfig['netgraph'] )); $group->add(new Form_MultiCheckbox( 'pf', null, 'PF', $pconfig['pf'] )); $group->add(new Form_MultiCheckbox( 'hostres', null, 'Host Resources', $pconfig['hostres'] )); $group->add(new Form_MultiCheckbox( 'ucd', null, 'UCD', $pconfig['ucd'] )); $group->add(new Form_MultiCheckbox( 'regex', null, 'Regex', $pconfig['regex'] )); $group->add(new Form_MultiCheckbox( 'junk', null, null, $pconfig['regex'] ))->displayAsRadio(); $section->add($group); $form->add($section); $section = new Form_Section('Interface Binding'); $section->addInput(new Form_Select( 'bindip', 'Bind Interface', $pconfig['bindip'], build_iplist() )); $form->add($section); print($form); ?>