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/check_MAXDB_Autosavelog.sh
#!/bin/bash
# Monitoreo si esta activo el AUTOSAVELOG
#  En MAXDB.
# por ARiel Tarallo -. 09-01-2013 Level 3
#
mon_name=$1 # recibe nombre de monitor.
usuario=$2
service=$3
instancia=$4
commando="autolog_show"
stat1="AUTOSAVE IS ON"

#echo "AUTOSAVELOG IS ON or OFF:"

su - $usuario -c "dbmcli -U c $commando | grep \"$stat1\" || echo DESACTIVADO" | while read LINE
do
        status1=$(echo $LINE)
        status1=`echo $status1`
        if [ "$status1" == "DESACTIVADO" ]; then
                        /opt/OV/bin/opcmon $mon_name=0 -object $service:$instancia
#                       echo $status1
                else
                        /opt/OV/bin/opcmon $mon_name=1 -object $service:$instancia
#                       echo $status1
                fi
done

exit 0