$key = trim($key);
$value = trim($value);
+ // params about backend nodes
if (preg_match("/^backend_hostname/", $key)) {
$num = str_replace('backend_hostname', '', $key);
$configParam['backend_hostname'][$num] = str_replace("'", "", $value);
$num = str_replace('backend_flag', '', $key);
$configParam['backend_flag'][$num] =str_replace("'", "", $value);
+ // params about watchdog monitoring
+ } elseif (preg_match("/^other_pgpool_hostname/", $key)) {
+ $num = str_replace('other_pgpool_hostname', '', $key);
+ $configParam['other_pgpool_hostname'][$num] = str_replace("'", "", $value);
+
+ } elseif (preg_match("/^other_pgpool_port/", $key)) {
+ $num = str_replace('other_pgpool_port', '', $key);
+ $configParam['other_pgpool_port'][$num] = $value;
+
+ } elseif (preg_match("/^other_wd_port/", $key)) {
+ $num = str_replace('other_wd_port', '', $key);
+ $configParam['other_wd_port'][$num] = $value;
+
} else {
$configParam[$key] = str_replace("'", "", $value);
}
!preg_match("/^backend_port/", $key) &&
!preg_match("/^backend_weight/", $key) &&
!preg_match("/^backend_data_directory/", $key) &&
- !preg_match("/^backend_flag/", $key))
+ !preg_match("/^backend_flag/", $key) &&
+ !preg_match("/^other_pgpool_hostname/", $key) &&
+ !preg_match("/^other_pgpool_port/", $key) &&
+ !preg_match("/^other_wd_port/", $key)
+ )
{
if (isset($configParam[$key])) {
$results[$key] = $configParam[$key]['default'];
}
/* check version */
+function hasWatchdog()
+{
+ return (3.2 <= _PGPOOL2_VERSION);
+}
+
function hasMemqcache()
{
return (3.2 <= _PGPOOL2_VERSION);
// params added in 3.2
case 'health_check_max_retries':
case 'health_check_retry_delay':
+ case 'use_watchdog':
+ case 'trusted_servers':
+ case 'delegate_IP':
+ case 'wd_hostname':
+ case 'wd_port':
+ case 'wd_interval':
+ case 'ping_path':
+ case 'ifconfig_path':
+ case 'if_up_cmd':
+ case 'if_down_cmd':
+ case 'arping_path':
+ case 'arping_cmd':
+ case 'wd_life_point':
+ case 'wd_lifecheck_query':
case 'memory_cache_enabled':
case 'memqcache_method':
case 'memqcache_memcached_host':
$pgpoolConfigParam[$key]['max'] = NUM_MAX;
#------------------------------------------------------------------------------
-# ON MEMORY QUERY CACHE
+# WATCHDOG
+#------------------------------------------------------------------------------
+
+$key = 'use_watchdog';
+$pgpoolConfigParam[$key]['type'] = 'B';
+$pgpoolConfigParam[$key]['default'] = 'off';
+
+$key = 'trusted_servers';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+$key = 'delegate_IP';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $addressreg;
+
+$key = 'wd_hostname';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $addressreg;
+
+$key = 'wd_port';
+$pgpoolConfigParam[$key]['type'] = 'N';
+$pgpoolConfigParam[$key]['default'] = 9000;
+$pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['min'] = 1024;
+
+$key = 'wd_interval';
+$pgpoolConfigParam[$key]['type'] = 'N';
+$pgpoolConfigParam[$key]['default'] = 10;
+$pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['min'] = 0;
+
+$key = 'ping_path';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+$key = 'ifconfig_path';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+$key = 'if_up_cmd';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+$key = 'if_down_cmd';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+$key = 'arping_path';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+$key = 'arping_cmd';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = '';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+$key = 'wd_life_point';
+$pgpoolConfigParam[$key]['type'] = 'N';
+$pgpoolConfigParam[$key]['default'] = 3;
+$pgpoolConfigParam[$key]['max'] = NUM_MAX;
+$pgpoolConfigParam[$key]['min'] = 0;
+
+$key = 'wd_lifecheck_query';
+$pgpoolConfigParam[$key]['type'] = 'C';
+$pgpoolConfigParam[$key]['default'] = 'SELECT 1';
+$pgpoolConfigParam[$key]['regexp'] = $anyelse;
+
+# Other pgpool Connection Settings
+
+$key = 'other_pgpool_hostname';
+$pgpoolConfigWdOtherParam[$key]['type'] = 'C';
+$pgpoolConfigWdOtherParam[$key]['default'] = '';
+$pgpoolConfigWdOtherParam[$key]['regexp'] = $hostreg;
+
+$key = 'other_pgpool_port';
+$pgpoolConfigWdOtherParam[$key]['type'] = 'N';
+$pgpoolConfigWdOtherParam[$key]['default'] = 9999;
+$pgpoolConfigWdOtherParam[$key]['min'] = 1024;
+$pgpoolConfigWdOtherParam[$key]['max'] = NUM_MAX;
+
+$key = 'other_wd_port';
+$pgpoolConfigWdOtherParam[$key]['type'] = 'N';
+$pgpoolConfigWdOtherParam[$key]['default'] = 9000;
+$pgpoolConfigWdOtherParam[$key]['min'] = 1024;
+$pgpoolConfigWdOtherParam[$key]['max'] = NUM_MAX;
+
+#------------------------------------------------------------------------------
+# ON MEMORY QUERY CACHE
#------------------------------------------------------------------------------
$key = 'memory_cache_enabled';
'lang' => 'en',
'strLang' => 'English',
+ 'descArping_path' => 'The path of a command to send an ARP request after the virtual IP is switched',
+ 'descArping_cmd' => 'The ommand to send an ARP request after the virtual IP is switched',
'descAuthentication_timeout' => 'Timeout in seconds to complete client authentication',
'descBackend_flag' => 'Allow failover and detach or not',
'descBackend_hostname' => 'The real PostgreSQL server name pgpool could connect',
'descBackend_socket_dir' => 'The socket directory PostgreSQL could connect',
'descBackend_weight' => 'Load balance weight when pgpool is running in the state of load balance mode',
'descBackend_data_directory' => 'PostgreSQL database directory',
+ 'descDelegate_IP' => 'The virtual IP address (VIP) of pgpool-II ',
'descBlack_function_list' => 'Comma separated functions which write to database',
'descBlack_memqcache_table_list' => 'Comma separated list of table names not to be cached',
'descChild_life_time' => 'Life of an idle child process in seconds',
'descHealth_check_max_retries' => 'The maximum number of times to retry a failed health check before'.
' giving up and initiating failover',
'descHealth_check_retry_delay' => 'The amount of time (in seconds) to sleep between failed health check retries',
+ 'descIfconfig_path' => 'The path of a command to switch the IP address',
+ 'descIf_down_cmd' => 'The command to bring up the virtual IP',
+ 'descIf_up_cmd' => 'The command to bring down the virtual IP',
'descIgnore_leading_white_space' => 'If true, ignore leading white spaces of each query while pgpool judges '.
'if the query is a SELECT so that it can be load balanced',
'descInsert_lock' => ' If you replicate a table having SERIAL data type column, '.
'descMemqcache_cache_block_size' => 'Cache block size in bytes',
'descMemqcache_oiddir' => 'Temporary work directory to record table OIDs',
'descNum_init_children' => 'Number of pgpool processes initially forked',
+ 'descOther_pgpool_hostname' => 'The hostname pgpool-II server to be monitored',
+ 'descOther_pgpool_port' => 'The port number for pgpool on pgpool-II server to be monitored',
+ 'descOther_wd_port' => 'The port number for watchdog on pgpool-II server to be monitored',
'descParallel_mode' => 'Run in parallel mode',
+ 'descPing_path' => 'The path of ping command for monitoring connection to the upper servers',
'descPcp_port' => 'The port number where pcp is running on',
'descPcp_socket_dir' => 'The socket directory pcp could connect',
'descPcp_timeout' => 'When there is no response in this time from client, it disconnects and stop',
'descSystem_db_port' => 'The port number system database could connect',
'descSystem_db_schema' => 'The schema name of system database',
'descSystem_db_user' => 'The username when connection system database',
+ 'descTrusted_servers' => 'The list of trusted servers to check the up stream connections',
+ 'descUse_watchdog' => 'Enable watchdog',
+ 'descWd_hostname' => 'The hostname or IP address in which pgpool-II works',
+ 'descWd_interval' => 'The interval between life checks of pgpool-II in second',
+ 'descWd_life_point' => 'The times to retry a failed life check of pgpool-II',
+ 'descWd_lifecheck_query' => 'Actual query to check pgpool-II',
+ 'descWd_port' => 'The port number on which pgpool-II works',
'descWhite_function_list' => 'Comma separated functions those do not write to Database',
'descWhite_memqcache_table_list' => 'Comma separated list of table names to be cached',
'lang' => 'ja',
'strLang' => '日本語',
+ 'descArping_path' => 'IP アドレス切り替え後に ARP リクエストを送信するコマンドのパス',
+ 'descArping_cmd' => 'IP アドレス切り替え後に ARP リクエストを送信するコマンド',
'descAuthentication_timeout' => 'クライアント認証のタイムアウト時間(秒)',
'descBackend_flag' => 'フェイルオーバやデタッチの可否',
'descBackend_hostname' => 'pgpoolが接続するPostgreSQLサーバ(postmaster)が動いているホスト名',
'descConnection_life_time' => 'コネクションプール中のコネクションの有効期間(秒)',
'descDebug_level' => 'デバッグメッセージの詳細レベル(0は無効)',
'descDelay_threshold' => '許容するスタンバイサーバの遅延(バイト)',
+ 'descDelegate_IP' => '仮想 IP アドレス',
'descEnable_pool_hba' => 'クライアント認証機能の有無',
'descEnable_query_cache' => 'クエリキャッシュ機能の有無',
'descFailover_command' => 'ノード切り離し時に起動するコマンド',
'descHealth_check_password' => 'ヘルスチェックを行うためのPostgreSQLパスワード',
'descHealth_check_max_retries' => 'ヘルスチェックに失敗した後にリトライする回数',
'descHealth_check_retry_delay' => 'ヘルスチェックのリトライの間の間隔(秒)',
+ 'descIfconfig_path' => 'ifconfig コマンドのパス',
+ 'descIf_down_cmd' => '仮想 IP を停止するために実行するコマンド',
+ 'descIf_up_cmd' => '仮想 IP を起動するために実行するコマンド',
'descIgnore_leading_white_space' => 'load balance時のSQL文行頭の空白を無視',
'descInsert_lock' => 'INSERT時に自動的にトランザクションの開始,テーブルロック,トランザクションの終了',
'descListen_addresses' => 'TCP/IPコネクションを受け付けるアドレス',
'descMemqcache_oiddir' => 'テーブルOIDを格納するディレクトリ',
'descNum_init_children' => 'Number of pgpool processes initially forked',
'descNum_init_children' => 'preforkするpgpoolのサーバプロセス数',
+ 'descOther_pgpool_hostname' => '監視する pgpool-II が稼働するホスト名',
+ 'descOther_pgpool_port' => '監視する pgpool-II が稼働するポート番号',
+ 'descOther_wd_port' => '監視する watchdog が稼働するポート番号',
'descParallel_mode' => 'パラレルモードでpgpoolを運転',
'descPcp_port' => 'pgpool-IIが受け付けているポート番号',
'descPcp_socket_dir' => 'pcpがコネクションを受け付けるUnix domain socketディレクトリ',
'descPcp_timeout' => 'この時間内にクライアントから応答がない場合はコネクションを切断して終了',
'descPgpool2_hostname' => 'pgpool2 が動作しているホスト名',
+ 'descPing_path' => 'ping コマンドのパス',
'descPort' => 'pgpoolがコネクションを受け付けるポート番号',
'descPrint_timestamp' => 'pgpoolのログにタイムスタンプを追加',
'descRecovery_user' => 'リカバリを行うためのPostgreSQLユーザ',
'descSystem_db_port' => 'System DBに接続するためのポート番号',
'descSystem_db_schema' => 'System DBのスキーマ',
'descSystem_db_user' => 'System DBに接続するときのユーザ名',
+ 'descTrusted_servers' => '上位サーバのコンマ区切りのリスト',
+ 'descUse_watchdog' => 'watchdog 機能の有無',
+ 'descWd_hostname' => 'watchdog プロセスが相互監視を受信するためのホスト名',
+ 'descWd_interval' => '死活監視の間隔(秒)',
+ 'descWd_life_point' => '死活監視のリトライ回数',
+ 'descWd_lifecheck_query' => '死活監視で実行するクエリ',
+ 'descWd_port' => 'watchdog プロセスが相互監視を受信するためのポート番号',
'descWhite_function_list' => 'データベースに書き込みを行なわないカンマ区切りの関数のリスト',
'descWhite_memqcache_table_list' => 'SELECT結果をキャッシュしたいテーブル名のカンマ区切りのリスト',
* is" without express or implied warranty.
*
* @author Ryuma Ando <ando@ecomas.co.jp>
- * @copyright 2003-2011 PgPool Global Development Group
+ * @copyright 2003-2012 PgPool Global Development Group
* @version CVS: $Id$
*/
switch ($action) {
case 'add':
+ case 'add_wd':
// Boolean value
foreach ($pgpoolConfigParam as $key => $value) {
}
}
+ // watchdog settings
+ if (isset($_POST['other_pgpool_hostname'])) {
+ $configValue['other_pgpool_hostname'] = $_POST['other_pgpool_hostname'];
+ } else {
+ $configValue['other_pgpool_hostname'] = array();
+
+ }
+
+ if (isset($_POST['other_pgpool_port'])) {
+ $configValue['other_pgpool_port'] = $_POST['other_pgpool_port'];
+ } else {
+ $configValue['other_pgpool_port'] = array();
+ }
+
+ if (isset($_POST['other_wd_port'])) {
+ $configValue['other_wd_port'] = $_POST['other_wd_port'];
+ } else {
+ $configValue['other_wd_port'] = array();
+ }
+
$tpl->assign('params', $configValue);
- $tpl->assign('isAdd', TRUE);
+ $tpl->assign('isAdd', ($action == 'add'));
+ $tpl->assign('isAddWd', ($action == 'add_wd'));
$tpl->display('pgconfig.tpl');
return;
case 'cancel':
+ case 'cancel_wd':
// Boolean value
foreach ($pgpoolConfigParam as $key => $value) {
if (isset($_POST['backend_data_directory'])) {
$configValue['backend_data_directory'] = $_POST['backend_data_directory'];
}
- if (isset($_POST['backend_flag'])) {
+ if (paramExists('backend_flag') && isset($_POST['backend_flag'])) {
$configValue['backend_flag'] = $_POST['backend_flag'];
}
-
array_pop($configValue['backend_hostname']);
array_pop($configValue['backend_port']);
array_pop($configValue['backend_weight']);
array_pop($configValue['backend_data_directory']);
array_pop($configValue['backend_flag']);
+
+ // watchdog settings
+ if (isset($_POST['other_pgpool_hostname'])) {
+ $configValue['other_pgpool_hostname'] = $_POST['other_pgpool_hostname'];
+ }
+ if (isset($_POST['other_pgpool_port'])) {
+ $configValue['other_pgpool_port'] = $_POST['other_pgpool_port'];
+ }
+ if (isset($_POST['other_wd_port'])) {
+ $configValue['other_wd_port'] = $_POST['other_wd_port'];
+ }
+ array_pop($configValue['other_pgpool_hostname']);
+ array_pop($configValue['other_pgpool_port']);
+ array_pop($configValue['other_wd_port']);
+
$tpl->assign('params', $configValue);
- $tpl->assign('isAdd', FALSE);
+ $tpl->assign('isAdd', !($action == 'cancel'));
+ $tpl->assign('isAddWd', !($action == 'cancel_wd'));
$tpl->display('pgconfig.tpl');
return;
$configValue[$key] = $_POST[$key];
}
}
+
/**
* check backend value
*/
}
}
+ /**
+ * copy backend value from POST data to $configValue
+ */
+ foreach ($pgpoolConfigWdOtherParam as $key => $value) {
+ if (isset($_POST[$key])) {
+ $configValue[$key] = $_POST[$key];
+ }
+ }
+
+ /**
+ * check other watchdog value
+ */
+ if (isset($configValue['other_pgpool_hostname'])) {
+ for ($i = 0; $i < count($configValue['other_pgpool_hostname']); $i++) {
+ $result = FALSE;
+
+ // other_pgpool_hostname
+ $result = checkString($configValue['other_pgpool_hostname'][$i],
+ $pgpoolConfigWdOtherParam['other_pgpool_hostname']['regexp']);
+ if (!$result) {
+ $error['other_pgpool_hostname'][$i] = TRUE;
+ }
+
+ // other_pgpool_port
+ $result = checkInteger($configValue['other_pgpool_port'][$i],
+ $pgpoolConfigWdOtherParam['other_pgpool_port']['min'],
+ $pgpoolConfigWdOtherParam['other_pgpool_port']['max']);
+
+ // other_wd_port
+ $result = checkInteger($configValue['other_wd_port'][$i],
+ $pgpoolConfigWdOtherParam['other_wd_port']['min'],
+ $pgpoolConfigWdOtherParam['other_wd_port']['max']);
+ }
+ }
+
+ /*
+ * Chek if there is errors
+ */
$isError = FALSE;
foreach ($error as $key => $value) {
if (preg_match("/^backend_hostname/", $key) ||
}
}
- } else {
- if ($value == TRUE) {
- $isError = TRUE;
+ } elseif (
+ preg_match("/^other_pgpool_hostname/", $key) ||
+ preg_match("/^other_pgpool_port/", $key) ||
+ preg_match("/^other_wd_port/", $key))
+ {
+ for ($i = 0; $i < count($value); $i++) {
+ if ($value[$i] == TRUE) {
+ $isError = TRUE;
+ }
}
+
+ } elseif ($value == TRUE) {
+ $isError = TRUE;
}
if ($isError) { break; }
}
+ /**
+ * Display
+ */
if (!$isError) {
if (is_writable(_PGPOOL2_CONFIG_FILE)) {
writeConfigFile($configValue, $pgpoolConfigParam);
break;
case 'delete':
+ case 'delete_wd':
$num = $_POST['num'];
- deleteBackendHost($num, $configValue);
+
+ switch ($action) {
+ case 'delete':
+ deleteBackendHost($num, $configValue); break;
+ case 'delete_wd':
+ deleteWdOther($num, $configValue); break;
+ }
if (is_writable(_PGPOOL2_CONFIG_FILE)) {
writeConfigFile($configValue, $pgpoolConfigParam);
{
$configFile = @file(_PGPOOL2_CONFIG_FILE);
- $removeBackendConfigFile = array();
-
+ $tmpConfigFile = array();
for ($i = 0; $i < count($configFile); $i++) {
$line = $configFile[$i];
!preg_match("/^backend_port/", $key) &&
!preg_match("/^backend_weight/", $key) &&
!preg_match("/^backend_data_directory/", $key) &&
- !preg_match("/^backend_flag/", $key))
+ !preg_match("/^backend_flag/", $key) &&
+ !preg_match("/^other_pgpool_hostname/", $key) &&
+ !preg_match("/^other_pgpool_port/", $key) &&
+ !preg_match("/^other_wd_port/", $key)
+ )
{
- $removeBackendConfigFile[] = $line;
+ $tmpConfigFile[] = $line;
}
} else {
- $removeBackendConfigFile[] = $line;
+ $tmpConfigFile[] = $line;
}
}
-
- $configFile = $removeBackendConfigFile;
+ $configFile = $tmpConfigFile;
foreach ($pgpoolConfigParam as $key => $value) {
$isWrite = FALSE;
if (isset($configValue['backend_hostname'])) {
for ($i = 0; $i < count($configValue['backend_hostname']); $i++) {
- $line = "backend_hostname$i = '" . $configValue['backend_hostname'][$i] . "'\n";
- $configFile[] = $line;
-
- $line = "backend_port$i = " . $configValue['backend_port'][$i] . "\n";
- $configFile[] = $line;
-
- $line = "backend_weight$i = " . $configValue['backend_weight'][$i] . "\n";
- $configFile[] = $line;
-
- $line = "backend_data_directory$i = '" . $configValue['backend_data_directory'][$i] . "'\n";
- $configFile[] = $line;
+ $configFile[] = "backend_hostname$i = '" . $configValue['backend_hostname'][$i] . "'\n";
+ $configFile[] = "backend_port$i = " . $configValue['backend_port'][$i] . "\n";
+ $configFile[] = "backend_weight$i = " . $configValue['backend_weight'][$i] . "\n";
+ $configFile[] = "backend_data_directory$i = '" . $configValue['backend_data_directory'][$i] . "'\n";
if (paramExists('backend_flag')) {
- $line = "backend_flag$i= '" . $configValue['backend_flag'][$i] . "'\n";
- $configFile[] = $line;
+ $configFile[] = "backend_flag$i= '" . $configValue['backend_flag'][$i] . "'\n";
}
}
}
+ if (isset($configValue['other_pgpool_hostname'])) {
+ for ($i = 0; $i < count($configValue['other_pgpool_hostname']); $i++) {
+ $configFile[] = "other_pgpool_hostname$i = '" . $configValue['other_pgpool_hostname'][$i] . "'\n";
+ $configFile[] = "other_pgpool_port$i = " . $configValue['other_pgpool_port'][$i] . "\n";
+ $configFile[] = "other_wd_port$i = " . $configValue['other_wd_port'][$i] . "\n";
+ }
+ }
+
$outfp = fopen(_PGPOOL2_CONFIG_FILE, 'w');
foreach ($configFile as $line) {
fputs($outfp, $line);
}
}
+/**
+ * Delete an other watchdog
+ */
+function deleteWdOther($num, &$configValue)
+{
+ unset($configValue['other_pgpool_hostname'][$num]);
+ $configValue['other_pgpool_hostname'] = array_values($configValue['other_pgpool_hostname']);
+
+ unset($configValue['other_pgpool_port'][$num]);
+ $configValue['other_pgpool_port'] = array_values($configValue['other_pgpool_port']);
+
+ unset($configValue['other_wd_port'][$num]);
+ $configValue['other_wd_port'] = array_values($configValue['other_wd_port']);
+}
?>
document.pgconfig.submit();
}
+function addOtherWatchdog() {
+ document.pgconfig.action.value= "add_wd";
+ document.pgconfig.submit();
+}
+
+function cancelOtherWatchdog() {
+ document.pgconfig.action.value= "cancel_wd";
+ document.pgconfig.submit();
+}
+function delOtherWatchdog(num){
+ if(window.confirm(msgDeleteConfirm)){
+ document.pgconfig.action.value= "delete_wd";
+ document.pgconfig.num.value = num;
+ document.pgconfig.submit();
+ }
+}
+
+
// -->
</script>
{/literal}
<li><a href="#health-check">Health Check</a></li>
<li><a href="#failover">Failover and Failback</a></li>
<li><a href="#recovery">Online Recovery</a></li>
+ {if hasWatchdog()}
+ <li><a href="#watchdog">Watchdog</a></li>
+ {/if}
{if hasMemqcache()}
<li><a href="#memqcache">On Memory Query Cache</a></li>
{/if}
</tbody>
</table>
+ {if hasMemqcache()}
+ {* --------------------------------------------------------------------- *
+ * Watchdog *
+ * --------------------------------------------------------------------- *}
+ <h3><a name="watchdog" id="watchdog">Watchdog</a></h3>
+
+ <table>
+ <thead>
+ <tr>
+ <th>{$message.strParameter|escape}</th>
+ <th colspan="2">{$message.strValue|escape}</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <th{if isset($error.use_watchdog)} class="error"{/if}>
+ <label>{$message.descUse_watchdog|escape}</label>
+ <br />use_watchdog (bool)</th>
+ <td colspan="2"><input type="checkbox" name="use_watchdog" id="use_watchdog" value="true"
+ {if $params.use_watchdog== 'on'}checked="checked"{/if} /></td>
+ </tr>
+
+ <tr><th class="category" colspan="3">Connection to up stream servers</th></tr>
+
+ <tr>
+ <th{if isset($error.trusted_servers)} class="error"{/if}>
+ <label>{$message.descTrusted_servers|escape}</label>
+ <br />trusted_servers (string) *</th>
+ <td colspan="2"><input type="text" name="trusted_servers" value="{$params.trusted_servers|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.ping_path)} class="error"{/if}>
+ <label>{$message.descPing_path|escape}</label>
+ <br />ping_path (string) *</th>
+ <td colspan="2"><input type="text" name="ping_path" value="{$params.ping_path|escape}"/></td>
+ </tr>
+
+ <tr><th class="category" colspan="3">Lifecheck of pgpol-II</th></tr>
+
+ <tr>
+ <th{if isset($error.wd_interval)} class="error"{/if}>
+ <label>{$message.descWd_interval|escape}</label>
+ <br />wd_interval (integer)</th>
+ <td colspan="2"><input type="text" name="wd_interval" value="{$params.wd_interval|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.wd_life_point)} class="error"{/if}>
+ <label>{$message.descWd_life_point|escape}</label>
+ <br />wd_life_point(integer)</th>
+ <td colspan="2"><input type="text" name="wd_life_point" value="{$params.wd_life_point|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.wd_lif_check_query)} class="error"{/if}>
+ <label>{$message.descWd_lifecheck_query|escape}</label>
+ <br />wd_lifecheck_query (string)</th>
+ <td colspan="2"><input type="text" name="wd_lifecheck_query" value="{$params.wd_lifecheck_query|escape}"/></td>
+ </tr>
+
+ <tr><th class="category" colspan="3">Virtual IP address</th></tr>
+
+ <tr>
+ <th{if isset($error.delegate_IP)} class="error"{/if}>
+ <label>{$message.descDelegate_IP|escape}</label>
+ <br />delegate_IP (string)</th>
+ <td colspan="2"><input type="text" name="delegate_IP" value="{$params.delegate_IP|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.ifconfig_path)} class="error"{/if}>
+ <label>{$message.descIfconfig_path|escape}</label>
+ <br />ifconfig_path (string)</th>
+ <td colspan="2"><input type="text" name="ifconfig_path" value="{$params.ifconfig_path|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.if_up_cmd)} class="error"{/if}>
+ <label>{$message.descIf_up_cmd|escape}</label>
+ <br />if_up_cmd (string)</th>
+ <td colspan="2"><input type="text" name="if_up_cmd" value="{$params.if_up_cmd|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.if_down_cmd)} class="error"{/if}>
+ <label>{$message.descIf_down_cmd|escape}</label>
+ <br />if_down_cmd (string)</th>
+ <td colspan="2"><input type="text" name="if_down_cmd" value="{$params.if_down_cmd|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.arping_path)} class="error"{/if}>
+ <label>{$message.descArping_path|escape}</label>
+ <br />arping_path (string)</th>
+ <td colspan="2"><input type="text" name="arping_path" value="{$params.arping_path|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.arping_cmd)} class="error"{/if}>
+ <label>{$message.descArping_cmd|escape}</label>
+ <br />arping_cmd (string)</th>
+ <td colspan="2"><input type="text" name="arping_cmd" value="{$params.arping_cmd|escape}"/></td>
+ </tr>
+
+ <tr><th class="category" colspan="3">Server itself to be monitored</th></tr>
+
+ <tr>
+ <th{if isset($error.wd_hostname)} class="error"{/if}>
+ <label>{$message.descWd_hostname|escape}</label>
+ <br />wd_hostname (string)</th>
+ <td colspan="2"><input type="text" name="wd_hostname" value="{$params.wd_hostname|escape}"/></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.wd_port)} class="error"{/if}>
+ <label>{$message.descWd_port|escape}</label>
+ <br />arping_cmd (integer)</th>
+ <td colspan="2"><input type="text" name="wd_port" value="{$params.wd_port|escape}"/></td>
+ </tr>
+
+ <tr><th class="category" colspan="3">Servers to monitor</th></tr>
+
+ {section name=num loop=$params.other_pgpool_hostname}
+ <tr>
+ <th{if isset($error.other_pgpool_hostname[num])} class="error"{/if}>
+ <label>{$message.descOther_pgpool_hostname|escape}</label>
+ <br />other_pgpool_hostname{$smarty.section.num.index} (string)</th>
+ <td><input type="text" name="other_pgpool_hostname[]" value="{$params.other_pgpool_hostname[num]|escape}" /></td>
+ <td rowspan="3">
+ <input type="button" name="delete" value="{$message.strDelete|escape}"
+ onclick="delOtherWatchdog({$smarty.section.num.index})" /></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.other_pgpool_port[num])} class="error"{/if}>
+ <label>{$message.descOther_pgpool_port|escape}</label>
+ <br />other_pgpool_port{$smarty.section.num.index|escape} (integer)</th>
+ <td><input type="text" name="other_pgpool_port[]" value="{$params.other_pgpool_port[num]|escape}" /></td>
+ </tr>
+
+ <tr>
+ <th{if isset($error.other_wd_port[num])} class="error"{/if}>
+ <label>{$message.descOther_wd_port|escape}</label>
+ <br />other_wd_port{$smarty.section.num.index|escape} (integer)</th>
+ <td><input type="text" name="other_wd_port[]" value="{$params.other_wd_port[num]|escape}" /></td>
+ </tr>
+ {/section}
+
+ {if isset($isAddWd) && $isAddWd == true}
+ <tr>
+ <th><label>{$message.descOther_pgpool_hostname|escape}</label>
+ <br />other_pgpool_hostname{$smarty.section.num.index} (string)</th>
+ <td><input type="text" name="other_pgpool_hostname[]" value="" /></td>
+ </tr>
+
+ <tr>
+ <th><label>{$message.descOther_pgpool_port|escape}</label>
+ <br />other_pgpool_port{$smarty.section.num.index|escape} (integer)</th>
+ <td><input type="text" name="other_pgpool_port[]" value="" /></td>
+ </tr>
+
+ <tr>
+ <th><label>{$message.descOther_wd_port|escape}</label>
+ <br />other_wd_port{$smarty.section.num.index|escape} (integer)</th>
+ <td><input type="text" name="other_wd_port[]" value="" /></td>
+ </tr>
+ {/if}
+
+ </tbody>
+ {if isset($isAddWd) && $isAddWd == true}
+ <tfoot>
+ <tr>
+ <td colspan="3">
+ <input type="button" name="cancel" value="{$message.strCancel|escape}" onclick="cancelOtherWatchdog()" /></td>
+ </tr>
+ </tfoot>
+ {else}
+ <tfoot>
+ <tr>
+ <td colspan="3">
+ <input type="button" name="add" value="{$message.strAdd|escape}" onclick="addOtherWatchdog()" /></td>
+ </tr>
+ </tfoot>
+ {/if}
+ </table>
+ {/if}
+
{if hasMemqcache()}
{* --------------------------------------------------------------------- *
* On Memory Query Cache *