-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathkeep_alive_iq.sh
More file actions
33 lines (32 loc) · 1.19 KB
/
Copy pathkeep_alive_iq.sh
File metadata and controls
33 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/sh
############################################################################
#
# Programa: keep_alive_iq
# Version: 0.1
# Descripcion: Control para verificar la disponibilidad de sybase iq
# Historial de Actualizaciones:
# 2017-07-12 - 0.1 - Keep Alive Sybase IQ
############################################################################
ARCH_SQL=test_script #Archivo sql a ejecutar
PATH_CTRL=${HOME}/ # Path del Archivo sql a ejecutar
INST=pr_iqprod # Instancia
BASE=cobisiq # Base
SYBUSR=monitoreo
SYBPWD=passw0rd
echo "Ejecutando...: DBISQL "
echo "-----------------------------------------------------------------------"
dbisql -nogui -c "uid=${SYBUSR};pwd=${SYBPWD};eng=${INST};dbn=${BASE}" ${PATH_CTRL}${ARCH_SQL}.sql > ${PATH_CTRL}${ARCH_SQL}.out &
sleep 20
CTRL=`grep 'OK' ${PATH_CTRL}${ARCH_SQL}.out`
chrlenctrl=${#CTRL}
if [ ${chrlenctrl} -eq 0 ]
then
echo "ERROR"
echo "ERROR EN LA RESPUESTA O DEMORA" > ${PATH_CTRL}/Salida.out
exit
else
echo "OK"
echo "OK" > ${PATH_CTRL}/Salida.out
fi
echo "-----------------------------------------------------------------------"
echo "FIN"