Re: Communication error between Oracle and Nagios
Posted: Fri Nov 26, 2021 8:36 am
Hi.
The code for the votedisk check is as follows:
The code for the votedisk check is as follows:
Code: Select all
#!/bin/bash
##########################################################
export ORACLE_HOME=/oracle/app/db/19300
export ORACLE_BASE=/oracle/app/base
nagios_exit_codes=('UNKNOWN', 3, 'OK', 0, 'WARNING', 1, 'CRITICAL', 2)
status='OK'
ok=1
action=$1
##########################################################
comprueba=$(cat /tmp/fich.tmp | grep CRS-4638)
if [ $? ]
then
case $action in
"votedisk")
comando=$(/oracle/app/grid/19300/bin/crsctl query css votedisk)
case $comando in
*"failed"*|*"OFFLINE"*|*"PROC"*)
status='CRITICAL'
output_msg="Voting disk status check failed!"
;;
* )
output_msg="Voting disks status check succeeded"
;;
esac
output="[$status] $output_msg - $comando"
;;
esac
else
output="[CRITICAL] At least one clusterware service is down!\n"
codigo_salida=2
fi
echo -e $output
exit $codigo_salida