Projet

Général

Profil

« Précédent | Suivant » 

Révision a99547e4

Ajouté par Ermal il y a plus de 9 ans

Provide a toggle for apinger debug messages to be logged to syslog. To help with roubleshooting issues

Voir les différences:

etc/inc/gwlb.inc
44 44
		"avg_delay_samples" => "10",
45 45
		"avg_loss_samples" => "50",
46 46
		"avg_loss_delay_samples" => "20");
47
	}
47
}
48 48

  
49 49
/*
50 50
 * Creates monitoring configuration file and
......
61 61
		return;
62 62
	}
63 63

  
64
	$apinger_debug = "";
65
	if (isset($config['system']['apinger_debug']))
66
		$apinger_debug = "debug on";
67

  
64 68
	$apinger_default = return_apinger_defaults();
65 69
	$apingerconfig = <<<EOD
66 70

  
67 71
# pfSense apinger configuration file. Automatically Generated!
68 72

  
73
{$apinger_debug}
74

  
69 75
## User and group the pinger should run as
70 76
user "root"
71 77
group "wheel"
usr/local/www/system_advanced_misc.php
64 64
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
65 65
$pconfig['kill_states'] = isset($config['system']['kill_states']);
66 66
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
67
$pconfig['apinger_debug'] = isset($config['system']['apinger_debug']);
67 68
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
68 69
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
69 70
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
......
188 189
		else
189 190
			unset($config['system']['skip_rules_gw_down']);
190 191

  
192
		$need_apinger_restart = false;
193
		if($_POST['apinger_debug'] == "yes") {
194
			if (!isset($config['system']['apinger_debug']))
195
				$need_apinger_restart = true;
196
			$config['system']['apinger_debug'] = true;
197
		} else {
198
			if (isset($config['system']['apinger_debug']))
199
				$need_apinger_restart = true;
200
			unset($config['system']['apinger_debug']);
201
		}
202

  
191 203
		if($_POST['use_mfs_tmpvar'] == "yes")
192 204
			$config['system']['use_mfs_tmpvar'] = true;
193 205
		else
......
220 232
		load_thermal_hardware();
221 233
		if ($need_relayd_restart)
222 234
			relayd_configure();
235
		if ($need_apinger_restart)
236
			setup_gateways_monitor();
223 237
	}
224 238
}
225 239

  
......
501 515
									"and the rule is not created when gateway is down"); ?>
502 516
								</td>
503 517
							</tr>
518
							<tr>
519
								<td width="22%" valign="top" class="vncell"><?=gettext("Enable debugging messages of gateway monitoring daemon"); ?></td>
520
								<td width="78%" class="vtable">
521
									<input name="apinger_debug" type="checkbox" id="apinger_debug" value="yes" <?php if ($pconfig['apinger_debug']) echo "checked=\"checked\""; ?> />
522
									<br />
523
									<?=gettext("By default, gateway monitoring does not log its error messages, ".
524
									"by toggling this setting the daemon would enable logging its messages to syslog."); ?>
525
								</td>
526
							</tr>
504 527
							<tr>
505 528
								<td colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></td>
506 529
							</tr>

Formats disponibles : Unified diff