Commit e2276435 authored by Franco Fichtner's avatar Franco Fichtner

gateways: set monitoring off by default; fixes #2

parent ae07d41a
...@@ -63,18 +63,11 @@ function setup_gateways_monitor() ...@@ -63,18 +63,11 @@ function setup_gateways_monitor()
return; return;
} }
$apinger_debug = "";
if (isset($config['system']['apinger_debug'])) {
$apinger_debug = "debug on";
}
$apinger_default = return_apinger_defaults(); $apinger_default = return_apinger_defaults();
$apingerconfig = <<<EOD $apingerconfig = <<<EOD
# OPNsense apinger configuration file. Automatically Generated! # OPNsense apinger configuration file. Automatically Generated!
{$apinger_debug}
## User and group the pinger should run as ## User and group the pinger should run as
user "root" user "root"
group "wheel" group "wheel"
...@@ -600,6 +593,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -600,6 +593,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
$gateway['monitor'] = $gateway['gateway']; $gateway['monitor'] = $gateway['gateway'];
$gateway['descr'] = "Interface {$friendly}{$ctype} Gateway"; $gateway['descr'] = "Interface {$friendly}{$ctype} Gateway";
$gateway['monitor_disable'] = true;
$gateways_arr[$gateway['name']] = $gateway; $gateways_arr[$gateway['name']] = $gateway;
} }
unset($gateway); unset($gateway);
...@@ -684,6 +678,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -684,6 +678,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
$gateway['monitor'] = $gateway['gateway']; $gateway['monitor'] = $gateway['gateway'];
$gateway['descr'] = "Interface {$friendly}{$ctype} Gateway"; $gateway['descr'] = "Interface {$friendly}{$ctype} Gateway";
$gateway['monitor_disable'] = true;
$gateways_arr[$gateway['name']] = $gateway; $gateways_arr[$gateway['name']] = $gateway;
} }
unset($gateway); unset($gateway);
......
...@@ -50,7 +50,6 @@ $pconfig['thermal_hardware'] = $config['system']['thermal_hardware']; ...@@ -50,7 +50,6 @@ $pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
$pconfig['schedule_states'] = isset($config['system']['schedule_states']); $pconfig['schedule_states'] = isset($config['system']['schedule_states']);
$pconfig['kill_states'] = isset($config['system']['kill_states']); $pconfig['kill_states'] = isset($config['system']['kill_states']);
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']); $pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
$pconfig['apinger_debug'] = isset($config['system']['apinger_debug']);
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']); $pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size']; $pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size']; $pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
...@@ -185,19 +184,6 @@ if ($_POST) { ...@@ -185,19 +184,6 @@ if ($_POST) {
unset($config['system']['skip_rules_gw_down']); unset($config['system']['skip_rules_gw_down']);
} }
$need_apinger_restart = false;
if ($_POST['apinger_debug'] == "yes") {
if (!isset($config['system']['apinger_debug'])) {
$need_apinger_restart = true;
}
$config['system']['apinger_debug'] = true;
} else {
if (isset($config['system']['apinger_debug'])) {
$need_apinger_restart = true;
}
unset($config['system']['apinger_debug']);
}
if ($_POST['use_mfs_tmpvar'] == "yes") { if ($_POST['use_mfs_tmpvar'] == "yes") {
$config['system']['use_mfs_tmpvar'] = true; $config['system']['use_mfs_tmpvar'] = true;
} else { } else {
...@@ -233,9 +219,6 @@ if ($_POST) { ...@@ -233,9 +219,6 @@ if ($_POST) {
if ($need_relayd_restart) { if ($need_relayd_restart) {
relayd_configure(); relayd_configure();
} }
if ($need_apinger_restart) {
setup_gateways_monitor();
}
} }
} }
...@@ -553,17 +536,6 @@ endforeach; ?> ...@@ -553,17 +536,6 @@ endforeach; ?>
"and the rule is not created when gateway is down"); ?> "and the rule is not created when gateway is down"); ?>
</td> </td>
</tr> </tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Enable debugging messages of gateway monitoring daemon"); ?></td>
<td width="78%" class="vtable">
<input name="apinger_debug" type="checkbox" id="apinger_debug" value="yes" <?php if ($pconfig['apinger_debug']) {
echo "checked=\"checked\"";
} ?> />
<br />
<?=gettext("By default, gateway monitoring does not log its error messages, ".
"by toggling this setting the daemon would enable logging its messages to syslog."); ?>
</td>
</tr>
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></td> <td colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></td>
</tr> </tr>
......
...@@ -89,6 +89,8 @@ if (isset($id) && $a_gateways[$id]) { ...@@ -89,6 +89,8 @@ if (isset($id) && $a_gateways[$id]) {
$pconfig['descr'] = $a_gateways[$id]['descr']; $pconfig['descr'] = $a_gateways[$id]['descr'];
$pconfig['attribute'] = $a_gateways[$id]['attribute']; $pconfig['attribute'] = $a_gateways[$id]['attribute'];
$pconfig['disabled'] = isset($a_gateways[$id]['disabled']); $pconfig['disabled'] = isset($a_gateways[$id]['disabled']);
} else {
$pconfig['monitor_disable'] = true;
} }
if (isset($_GET['dup']) && is_numericint($_GET['dup'])) { if (isset($_GET['dup']) && is_numericint($_GET['dup'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment