[Xymon] error foe script to monitor database

Sailesh sailesh.mohabeer at mns.intnet.mu
Thu Dec 8 06:47:31 CET 2011


Hi all,

 

I have a script to monitor my oracle databse. I am getting the error below
on my browser. The script where the error is happening is below. The problem
is that the script is retuning a null value instead of my sid which is cnp1.

 

Please can anyone help where there is a problem in the script.

 

Database check: cnp1 is down or in hung state 
ERROR: ORA-12154: TNS:could not resolve the connect identifier specified
SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS
{SYSDBA|SYSOPER|SYSASM}] [edition=value]] where ::= [/][@] ::= [][/][@]
SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS
{SYSDBA|SYSOPER|SYSASM}] [edition=value]] where ::= [/][@] ::= [][/][@]
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

 

 

################################################################

# DATABASE CHECK function

################################################################

function FUNC_DATABASE_CHECK

{

[[ "$DEBUG" = "Y" ]] && set -xv

set -f # turn off globbing

 

DB_CHECK=`$SQLPLUS -s $DB_USER/$DB_PASSWORD <<EOF 2>&1

set feedback off

set pagesize 0

set trimspool on

ttitle off

btitle off

set verify off

set linesize 260

select '$ORACLE_SID is up' FROM dual

/

EOF

`

if [[ "$DB_CHECK" != "$ORACLE_SID is up" ]]; then

        echo "$SPACER&red Database check: ${ORACLE_SID} is down or in hung
state"

        for line in $DB_CHECK

        do

                DB="$DB $line"

                [[ "$line" = "" ]] && break

        done

        [[ -n $DB ]] && DB_CHECK="$DB"  # move it to look good

        echo "<br>$DB_CHECK<br>"

        [[ "$DATABASE_NOTIFY" = "N" ]] && [[ "$COLOR" != "red" ]] &&
COLOR="yellow" || CO

LOR='red'

else

        echo "$SPACER&green Database check: ${ORACLE_SID} is up"

fi

}

 

Regards,

Sailesh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20111208/7d07294c/attachment.html>


More information about the Xymon mailing list