HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: //var/opt/OV/bin/instrumentation/ctrl_status_oas_2.sh
#!/bin/sh
# Control de procesos Oracle y Web Server del Cliente MEN.
# Autor Bernardo Callejas - FRSI -
# Correo [email protected]
# Version 1.0

# Variables
mon_name=$1
file_tmp=/tmp/ovo-ctrl.tmp
check_program=/oracle/product/oas10gr3/app/opmn/bin/opmnctl

# Ejecucion del control de verificacion
$check_program status | grep Down | grep -v ASG | cut -f 2 -d \| > $file_tmp
opmn=`$check_program status | grep "Unable to connect to opmn" | wc -l`

# Control de Aplicacion baja
if [ $opmn -eq 1 ]
then
	/opt/OV/bin/opcmon $mon_name=2
	exit 0
fi

# Control de Procesos Down
cant=`cat $file_tmp | wc -l`

if [ $cant -ne 0 ]
then
	while [ $cant -gt 0 ]
	do
	proceso=`sed -n "$cant p" $file_tmp`
	cant=`expr $cant - 1`
	/opt/OV/bin/opcmon $mon_name=1 -obj $proceso
	done
else
	/opt/OV/bin/opcmon $mon_name=0
fi
exit 0