[CentOS] Question about Shell Script.

Semih Gokalp semihgokalp at gmail.com
Fri Jan 30 13:40:28 UTC 2009


Hi all CentOS users,

I have writing shell script for check oracle processes in real time
and alert with e-mail.

I read script like below

NUMBEROFPRO=/oracle/10.2.0/db_1/bin/sqlplus / as sysdba <<EOF1 |grep
processes|awk '{print $2}'
SELECT resource_name,current_utilization,limit_value FROM
V\$RESOURCE_LIMIT WHERE RESOURCE_NAME IN ('processes','sessions');
quit
EOF1

if [ $NUMBEROFPRO > 150 ]
then
/bin/mail -s "Processes number bigger then 150 !!" myemailadres<<EOF
Contact your system administrator.
EOF
fi

Script print value correctly on screen but NUMBEROFPRO have empty
value in script.How can i take and print NUMBEROFPRO  value from above
query ?

Thanks for all.


More information about the CentOS mailing list