Skip to content

Commit

Permalink
Fix to support the change of "show pool_nodes" of Pgpool-II.
Browse files Browse the repository at this point in the history
  • Loading branch information
pengbo0328 committed Oct 30, 2018
1 parent 6cc81fc commit fcff01c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pg_monz/usr-local-bin/find_pgpool_backend_ip.sh
Expand Up @@ -35,7 +35,8 @@ if [ $? -ne 0 ]; then
exit
fi

echo "$result" | while read backendrecord; do
IFS=$'\n'
for backendrecord in $result; do
BACKENDID=`echo $backendrecord | awk -F, '{print $1}'`
BACKENDNAME=`echo $backendrecord | awk -F, '{print $2}'`
BACKENDPORT=`echo $backendrecord | awk -F, '{print $3}'`
Expand Down
4 changes: 3 additions & 1 deletion pg_monz/usr-local-bin/pgpool_backend_status.sh
Expand Up @@ -13,6 +13,8 @@ TIME=` date +%s`
# Load the pgpool connection option parameters.
source $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf

IFS=$'\n'

case "$APP_NAME" in
pgpool.nodes)
pool_nodes=$(psql -A --field-separator=',' -h $PGPOOLHOST -p $PGPOOLPORT -U $PGPOOLROLE -d $PGPOOLDATABASE -t -c "${BACKENDDB}" 2>&1)
Expand All @@ -22,7 +24,7 @@ case "$APP_NAME" in
exit
fi

sending_data=$(echo "$pool_nodes" | while read backendrecord; do
sending_data=$(for backendrecord in $pool_nodes; do
BACKENDID=`echo $backendrecord | awk -F, '{print $1}'`
BACKENDNAME=`echo $backendrecord | awk -F, '{print $2}'`
BACKENDPORT=`echo $backendrecord | awk -F, '{print $3}'`
Expand Down

0 comments on commit fcff01c

Please sign in to comment.