# # Setup customer DBs on probe # if [ -z "$PROBE" ]; then Warn "Probe name required for cust DB setup." elif [ -z "$CUST" ]; then Warn "Customer required for cust DB setup" else PGHOME=$(ls -vd /usr/pgsql* | tail -1) if [ -d "$PGHOME" ]; then PGDATA=/opt/iglass/pgdata/data${PGHOME/#\/usr\/pgsql}/ echo "Using PGDATA=$PGDATA" echo "hostssl all all 10.1.1.1/32 scram-sha-256" >> ${PGDATA}iglass/pg_hba.conf systemctl reload "postgresql${PGHOME/#\/usr\/pgsql}.service" else echo "Could not find pg versions for PGDATA. Hope this works." fi ADDR= for IP in $(hostname -I); do if echo $IP | grep -qE '^10\.1\.1\.'; then ADDR="$IP" fi done if [ -z "$ADDR" ]; then Warn "No local ip address found. Could not setup probe DB" else echo "Setting up $CUST DB for $PROBE at $ADDR:" $SSH "sudo -u noc /opt/iglass/bin/dbMgr.pl --db=$CUST --dbtype=cust-probe --host=$ADDR --create" $SSH "sudo -u noc /opt/iglass/bin/dbMgr.pl --db=$CUST --dbtype=cust-probe --host=$ADDR" $SSH "sudo -u noc /opt/iglass/bin/dbMgr.pl --db=$CUST --dbtype=cust-probe --host=$ADDR --schema=$PROBE-probe --create" $SSH "sudo -u noc /opt/iglass/bin/dbMgr.pl --db=$CUST --dbtype=cust-probe --host=$ADDR --schema=$PROBE-probe" fi if [ -d "$PGHOME" ]; then perl -ni -e 'print unless /\s10\.1\.1\.1\/32\s/' ${PGDATA}iglass/pg_hba.conf systemctl reload "postgresql${PGHOME/#\/usr\/pgsql}.service" fi fi Continue