Fix 7868 - Allow to enable hostres on all platforms after fix on FreeBSD-src

This commit is contained in:
Renato Botelho 2017-10-17 10:10:12 -02:00
parent 95605da1aa
commit e8972c2faf
2 changed files with 7 additions and 28 deletions

View File

@ -2351,15 +2351,6 @@ function services_unbound_configure($restart_dhcp = true) {
return $return;
}
function platform_snmpd_hostres_supported() {
// hostres causes high cpu usage on at least these hypervisors when a cd drive is pressent
// problem is confirmed on at least these platforms: vmware/hyperv/proxmox/virtualbox/xen
if (file_exists('/dev/cd0') && isvm()) {
return false;
}
return true;
}
function services_snmpd_configure() {
global $config, $g;
if (isset($config['system']['developerspew'])) {
@ -2528,8 +2519,7 @@ begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so"
EOD;
}
if (isset($config['snmpd']['modules']['hostres'])
&& platform_snmpd_hostres_supported()) {
if (isset($config['snmpd']['modules']['hostres'])) {
$snmpdconf .= <<<EOD
begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"

View File

@ -32,7 +32,6 @@
require_once("guiconfig.inc");
require_once("functions.inc");
require_once("services.inc");
if (!is_array($config['snmpd'])) {
$config['snmpd'] = array();
@ -317,14 +316,12 @@ $group->add(new Form_MultiCheckbox(
$pconfig['pf']
));
if (platform_snmpd_hostres_supported()) {
$group->add(new Form_MultiCheckbox(
'hostres',
null,
'Host Resources',
$pconfig['hostres']
));
}
$group->add(new Form_MultiCheckbox(
'hostres',
null,
'Host Resources',
$pconfig['hostres']
));
$group->add(new Form_MultiCheckbox(
'ucd',
@ -341,14 +338,6 @@ $group->add(new Form_MultiCheckbox(
));
$section->add($group);
if (!platform_snmpd_hostres_supported()) {
$section->addInput(new Form_StaticText(
NULL,
NULL
))->setHelp(sprint_info_box('The hostres module is not compatible with VMware/Proxmox/Virtualbox virtual ' .
'machines configured with a virtual CD/DVD Drive.', 'warning', false));
}
$form->add($section);
$section = new Form_Section('Interface Binding');