[mrtg] Re: TNS-Ping perl script

Patrick Bartkus patrckb at hotmail.com
Thu Apr 12 14:12:25 MEST 2001

>From: "Patrick Bartkus" <patrckb at hotmail.com>
>Has any written a Oracle TNS-Ping perl script using Perl DBI?
>I would like to create a target that tracked the ICMP ping times vrs.
>TNS-Ping times. I just need a little ammo in my "it's the network - no -
>it's the database" argument.<G>

Well, I invented the wheel myself. What I had to do is get the Oracle DBs to 
add the Oracle client onto my MRTG box. Then I just did the following 

----tnsping-lxop script -----

#	t n s p i n g - l x o p
#	This program will output two values
#		tnsping time to lxop instance on flossclxp
#		average time to flossclxp
#OK (150 msec)

my ($ICMPping);
my ($TNSping);

($ICMPping) = `/usr/local/bin/perl /usr/local/bin/mrtg-ping-probe -p avg/avg 
flossclxp |tail -1` ;

($TNSping) = `ORACLE_HOME=/files0/oracle/app/oracle/product/7.3.4;export 
ORACLE_HOME;/files0/oracle/app/oracle/product/7.3.4/bin/tnsping lxop | tail 
-1` ;

($TNSping) = $TNSping =~ /OK \((\d+) msec\)/;
print $ICMPping;
print "$TNSping\n" ;


The tricky part was that it wanted to know the environment variable 
ORACLE_HOME before tnsping would execute. It is working great.

Patrick Bartkus, CCNP Certified	Sr. Network Support Analyst
Fleet Mortgage Group		    Columbia, SC
If truth was not absolute, how could there be justice?

Get your FREE download of MSN Explorer at http://explorer.msn.com

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list