From f0ae8a9f2e59e982c1547605add9581e1d15b031 Mon Sep 17 00:00:00 2001 From: Max Khon Date: Fri, 26 Oct 2018 19:09:00 +0700 Subject: [PATCH] Use /bin/sh instead of /bin/bash --- pg_monz/usr-local-bin/find_dbname.sh | 4 ++-- pg_monz/usr-local-bin/find_dbname_table.sh | 4 ++-- pg_monz/usr-local-bin/find_pgpool_backend.sh | 4 ++-- pg_monz/usr-local-bin/find_pgpool_backend_ip.sh | 4 ++-- pg_monz/usr-local-bin/find_sr.sh | 4 ++-- pg_monz/usr-local-bin/find_sr_client_ip.sh | 4 ++-- pg_monz/usr-local-bin/pgpool_backend_status.sh | 4 ++-- pg_monz/usr-local-bin/pgpool_cache.sh | 4 ++-- pg_monz/usr-local-bin/pgpool_connections.sh | 4 ++-- pg_monz/usr-local-bin/pgpool_delegate_ip.sh | 4 ++-- pg_monz/usr-local-bin/pgpool_simple.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_db_funcs.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_primary.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_server_funcs.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_simple.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_sr_server_funcs.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_standby.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_tbl_funcs.sh | 4 ++-- pg_monz/usr-local-bin/pgsql_userdb_funcs.sh | 4 ++-- 19 files changed, 38 insertions(+), 38 deletions(-) diff --git a/pg_monz/usr-local-bin/find_dbname.sh b/pg_monz/usr-local-bin/find_dbname.sh index e11fb63..52bb0e7 100755 --- a/pg_monz/usr-local-bin/find_dbname.sh +++ b/pg_monz/usr-local-bin/find_dbname.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Get list of Database Name which you want to monitor. # The default settings are excepted template databases(template0/template1). @@ -13,7 +13,7 @@ PGSHELL_CONFDIR="$1" GETDB="select datname from pg_database where datistemplate = 'f';" # Load the pgsql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf result=$(psql -h $PGHOST -p $PGPORT -U $PGROLE -d $PGDATABASE -t -c "${GETDB}" 2>&1) if [ $? -ne 0 ]; then diff --git a/pg_monz/usr-local-bin/find_dbname_table.sh b/pg_monz/usr-local-bin/find_dbname_table.sh index 4ba2e9b..97af620 100755 --- a/pg_monz/usr-local-bin/find_dbname_table.sh +++ b/pg_monz/usr-local-bin/find_dbname_table.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" @@ -38,7 +38,7 @@ GETDB="select datname from pg_database where datistemplate = 'f';" GETTABLE="select row_to_json(t) from (select current_database() as \"{#DBNAME}\",schemaname as \"{#SCHEMANAME}\",tablename as \"{#TABLENAME}\" from pg_tables where schemaname not in ('pg_catalog','information_schema')) as t" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf # This low level discovery rules are disabled by deafult. dbname_list=$(psql -h $PGHOST -p $PGPORT -U $PGROLE -d $PGDATABASE -t -c "${GETDB}" 2>&1) diff --git a/pg_monz/usr-local-bin/find_pgpool_backend.sh b/pg_monz/usr-local-bin/find_pgpool_backend.sh index 666c430..28a2eb9 100755 --- a/pg_monz/usr-local-bin/find_pgpool_backend.sh +++ b/pg_monz/usr-local-bin/find_pgpool_backend.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Get list of pgpool-II database backend name which you want to monitor. @@ -7,7 +7,7 @@ PGPOOLSHELL_CONFDIR="$1" POOL_STATUS="show pool_status" # Load the pgpool connection option parameters. -source $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf +. $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf config=$(psql -A --field-separator=',' -h $PGPOOLHOST -p $PGPOOLPORT -U $PGPOOLROLE -d $PGPOOLDATABASE -t -c "${POOL_STATUS}" 2>&1) if [ $? -ne 0 ]; then diff --git a/pg_monz/usr-local-bin/find_pgpool_backend_ip.sh b/pg_monz/usr-local-bin/find_pgpool_backend_ip.sh index 99484f2..15d3ed0 100755 --- a/pg_monz/usr-local-bin/find_pgpool_backend_ip.sh +++ b/pg_monz/usr-local-bin/find_pgpool_backend_ip.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Get list of pgpool-II database backend name which you want to monitor. @@ -7,7 +7,7 @@ PGPOOLSHELL_CONFDIR="$1" POOL_STATUS="show pool_status" # Load the pgpool connection option parameters. -source $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf +. $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf config=$(psql -A --field-separator=',' -h $PGPOOLHOST -p $PGPOOLPORT -U $PGPOOLROLE -d $PGPOOLDATABASE -t -c "${POOL_STATUS}" 2>&1) if [ $? -ne 0 ]; then diff --git a/pg_monz/usr-local-bin/find_sr.sh b/pg_monz/usr-local-bin/find_sr.sh index f654365..386e18e 100755 --- a/pg_monz/usr-local-bin/find_sr.sh +++ b/pg_monz/usr-local-bin/find_sr.sh @@ -1,11 +1,11 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" GETROW="select count(*) from pg_stat_replication" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf result=$(psql -h $PGHOST -p $PGPORT -U $PGROLE -d $PGDATABASE -t -c "$GETROW" 2>&1) if [ $? -ne 0 ]; then diff --git a/pg_monz/usr-local-bin/find_sr_client_ip.sh b/pg_monz/usr-local-bin/find_sr_client_ip.sh index d745148..e3893c0 100755 --- a/pg_monz/usr-local-bin/find_sr_client_ip.sh +++ b/pg_monz/usr-local-bin/find_sr_client_ip.sh @@ -1,11 +1,11 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" GETTABLE="select row_to_json(t) from (select client_addr as \"{#SRCLIENT}\" from pg_stat_replication) as t" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf result=$(psql -h $PGHOST -p $PGPORT -U $PGROLE -d $PGDATABASE -t -c "${GETTABLE}" 2>&1) if [ $? -ne 0 ]; then diff --git a/pg_monz/usr-local-bin/pgpool_backend_status.sh b/pg_monz/usr-local-bin/pgpool_backend_status.sh index 2d509af..56409ef 100755 --- a/pg_monz/usr-local-bin/pgpool_backend_status.sh +++ b/pg_monz/usr-local-bin/pgpool_backend_status.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Get status of pgpool-II database backend which you want to monitor. @@ -11,7 +11,7 @@ BACKENDDB="show pool_nodes" TIME=` date +%s` # Load the pgpool connection option parameters. -source $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf +. $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf case "$APP_NAME" in pgpool.nodes) diff --git a/pg_monz/usr-local-bin/pgpool_cache.sh b/pg_monz/usr-local-bin/pgpool_cache.sh index 7470e81..4d092d1 100755 --- a/pg_monz/usr-local-bin/pgpool_cache.sh +++ b/pg_monz/usr-local-bin/pgpool_cache.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Get list of pgpool-II database backend name which you want to monitor. @@ -11,7 +11,7 @@ POOL="show pool_cache" TIME=` date +%s` # Load the pgpool connection option parameters. -source $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf +. $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf case "$APP_NAME" in pgpool.cache) diff --git a/pg_monz/usr-local-bin/pgpool_connections.sh b/pg_monz/usr-local-bin/pgpool_connections.sh index 96646ac..be017bc 100755 --- a/pg_monz/usr-local-bin/pgpool_connections.sh +++ b/pg_monz/usr-local-bin/pgpool_connections.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Get list of pgpool-II database backend name which you want to monitor. @@ -11,7 +11,7 @@ POOL="show pool_pools" TIME=` date +%s` # Load the pgpool connection option parameters. -source $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf +. $PGPOOLSHELL_CONFDIR/pgpool_funcs.conf case "$APP_NAME" in pgpool.connections) diff --git a/pg_monz/usr-local-bin/pgpool_delegate_ip.sh b/pg_monz/usr-local-bin/pgpool_delegate_ip.sh index d6cb92f..70d0e06 100755 --- a/pg_monz/usr-local-bin/pgpool_delegate_ip.sh +++ b/pg_monz/usr-local-bin/pgpool_delegate_ip.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgpool_funcs.conf +. $PGSHELL_CONFDIR/pgpool_funcs.conf if [ ! -n "$PGPOOLCONF" ]; then echo 0 diff --git a/pg_monz/usr-local-bin/pgpool_simple.sh b/pg_monz/usr-local-bin/pgpool_simple.sh index e6b4b45..88c47b5 100755 --- a/pg_monz/usr-local-bin/pgpool_simple.sh +++ b/pg_monz/usr-local-bin/pgpool_simple.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgpool_funcs.conf +. $PGSHELL_CONFDIR/pgpool_funcs.conf psql -t -A -h $PGPOOLHOST -p $PGPOOLPORT -U $PGPOOLROLE $PGPOOLDATABASE -c "select 1" 2>/dev/null if [ $? -ne 0 ]; then diff --git a/pg_monz/usr-local-bin/pgsql_db_funcs.sh b/pg_monz/usr-local-bin/pgsql_db_funcs.sh index 2044d88..44aec39 100755 --- a/pg_monz/usr-local-bin/pgsql_db_funcs.sh +++ b/pg_monz/usr-local-bin/pgsql_db_funcs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh APP_NAME="$1" PGSHELL_CONFDIR="$2" @@ -9,7 +9,7 @@ DBNAME="$5" TIMESTAMP_QUERY='extract(epoch from now())::int' # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf case "$APP_NAME" in pg.stat_database) diff --git a/pg_monz/usr-local-bin/pgsql_primary.sh b/pg_monz/usr-local-bin/pgsql_primary.sh index 3c90dd9..7ab3f43 100755 --- a/pg_monz/usr-local-bin/pgsql_primary.sh +++ b/pg_monz/usr-local-bin/pgsql_primary.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf result=$(psql -A -t -h $PGHOST -p $PGPORT -U $PGROLE -d $PGDATABASE -c "select (NOT(pg_is_in_recovery()))::int" 2>&1) echo "$result" diff --git a/pg_monz/usr-local-bin/pgsql_server_funcs.sh b/pg_monz/usr-local-bin/pgsql_server_funcs.sh index 0dc1619..7fdb620 100755 --- a/pg_monz/usr-local-bin/pgsql_server_funcs.sh +++ b/pg_monz/usr-local-bin/pgsql_server_funcs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #=============================================================================== # GLOBAL DECLARATIONS #=============================================================================== @@ -9,7 +9,7 @@ ZABBIX_AGENTD_CONF="$4" PARAM1="$5" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf TIMESTAMP_QUERY='extract(epoch from now())::int' diff --git a/pg_monz/usr-local-bin/pgsql_simple.sh b/pg_monz/usr-local-bin/pgsql_simple.sh index 1f763a6..a27f190 100755 --- a/pg_monz/usr-local-bin/pgsql_simple.sh +++ b/pg_monz/usr-local-bin/pgsql_simple.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf psql -t -A -h $PGHOST -p $PGPORT -U $PGROLE -d $PGDATABASE -c "select 1" 2>/dev/null if [ $? -ne 0 ]; then diff --git a/pg_monz/usr-local-bin/pgsql_sr_server_funcs.sh b/pg_monz/usr-local-bin/pgsql_sr_server_funcs.sh index c89f971..9afff60 100755 --- a/pg_monz/usr-local-bin/pgsql_sr_server_funcs.sh +++ b/pg_monz/usr-local-bin/pgsql_sr_server_funcs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #=============================================================================== # GLOBAL DECLARATIONS #=============================================================================== @@ -10,7 +10,7 @@ ZABBIX_AGENTD_CONF="$4" TIMESTAMP_QUERY='extract(epoch from now())::int' # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf PGVERSION=$(psql -A -t -h $PGHOST -p $PGPORT -U $PGROLE $PGDATABASE -c 'select * from version()' | cut -d ' ' -f 2 | sed -e 's/\([0-9]\+\.[0-9]\+\).*/\1/g') diff --git a/pg_monz/usr-local-bin/pgsql_standby.sh b/pg_monz/usr-local-bin/pgsql_standby.sh index 4e57775..2c3c952 100755 --- a/pg_monz/usr-local-bin/pgsql_standby.sh +++ b/pg_monz/usr-local-bin/pgsql_standby.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh PGSHELL_CONFDIR="$1" # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf result=$(psql -A -t -h $PGHOST -p $PGPORT -U $PGROLE -d $PGDATABASE -c "select pg_is_in_recovery()::int" 2>&1) echo "$result" diff --git a/pg_monz/usr-local-bin/pgsql_tbl_funcs.sh b/pg_monz/usr-local-bin/pgsql_tbl_funcs.sh index 11e1bc4..47e33db 100755 --- a/pg_monz/usr-local-bin/pgsql_tbl_funcs.sh +++ b/pg_monz/usr-local-bin/pgsql_tbl_funcs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh APP_NAME="$1" PGSHELL_CONFDIR="$2" @@ -11,7 +11,7 @@ TABLENAME="$7" TIMESTAMP_QUERY='extract(epoch from now())::int' # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf case "$APP_NAME" in pg.stat_table) diff --git a/pg_monz/usr-local-bin/pgsql_userdb_funcs.sh b/pg_monz/usr-local-bin/pgsql_userdb_funcs.sh index 2389e2e..eb9e391 100755 --- a/pg_monz/usr-local-bin/pgsql_userdb_funcs.sh +++ b/pg_monz/usr-local-bin/pgsql_userdb_funcs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh APP_NAME="$1" PGSHELL_CONFDIR="$2" @@ -9,7 +9,7 @@ DBNAME="$5" TIMESTAMP_QUERY='extract(epoch from now())::int' # Load the psql connection option parameters. -source $PGSHELL_CONFDIR/pgsql_funcs.conf +. $PGSHELL_CONFDIR/pgsql_funcs.conf case "$APP_NAME" in pg.size)