Oracle TNSping test shell script for Redhat Linux AS 3

If you have information, script, utility, or idea that can be useful for HostMonitor community, you welcome to share information in this forum.
Post Reply
tongyan
Posts: 6
Joined: Mon Apr 04, 2005 11:31 pm

Oracle TNSping test shell script for Redhat Linux AS 3

Post by tongyan »

#!/bin/sh
su - oracle -c "/u01/app/oracle/product/9.2.0/bin/tnsping $1" |tail -1 \
|awk '{if ($1=="OK") {ms=(substr($(NF-2),1)); \
printf ("ScriptRes:Ok:%d ms\n",ms)} else {printf ("ScriptRes:Bad:%d ms\n",ms)};exit}'
Nadir
Posts: 264
Joined: Mon Aug 29, 2005 2:01 am

Post by Nadir »

Hi all,
How this script works?
Is this script required just TNS alias?
Thanks for help
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Nadir wrote:How this script works?
Script is designed for "Shell Script" test method ( http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell )and should be performed by "RMA for *nix".
http://www.ks-soft.net/hostmon.eng/rma-unix/index.htm

Script executes tnsping utility with TNS alias, passed as parameter, checks the last line of the output (tail -1) and takes the response time.
Nadir wrote:Is this script required just TNS alias?
Corect.

Regards,
Max
Post Reply