diff options
-rw-r--r-- | etc/inc/gwlb.inc | 8 | ||||
-rw-r--r-- | usr/local/www/system_advanced_misc.php | 23 |
2 files changed, 30 insertions, 1 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 33b20cd..c5121fe 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -44,7 +44,7 @@ function return_apinger_defaults() { "avg_delay_samples" => "10", "avg_loss_samples" => "50", "avg_loss_delay_samples" => "20"); - } +} /* * Creates monitoring configuration file and @@ -61,11 +61,17 @@ function setup_gateways_monitor() { return; } + $apinger_debug = ""; + if (isset($config['system']['apinger_debug'])) + $apinger_debug = "debug on"; + $apinger_default = return_apinger_defaults(); $apingerconfig = <<<EOD # pfSense apinger configuration file. Automatically Generated! +{$apinger_debug} + ## User and group the pinger should run as user "root" group "wheel" diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php index d583efd..a224ffb 100644 --- a/usr/local/www/system_advanced_misc.php +++ b/usr/local/www/system_advanced_misc.php @@ -64,6 +64,7 @@ $pconfig['thermal_hardware'] = $config['system']['thermal_hardware']; $pconfig['schedule_states'] = isset($config['system']['schedule_states']); $pconfig['kill_states'] = isset($config['system']['kill_states']); $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_tmp_size'] = $config['system']['use_mfs_tmp_size']; $pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size']; @@ -188,6 +189,17 @@ if ($_POST) { else 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") $config['system']['use_mfs_tmpvar'] = true; else @@ -220,6 +232,8 @@ if ($_POST) { load_thermal_hardware(); if ($need_relayd_restart) relayd_configure(); + if ($need_apinger_restart) + setup_gateways_monitor(); } } @@ -502,6 +516,15 @@ function tmpvar_checked(obj) { </td> </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> <td colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></td> </tr> <?php if ($g['platform'] == "pfSense"): ?> |