Home » RDBMS Server » Enterprise Manager » Help with TCL script
icon5.gif  Help with TCL script [message #135282] Tue, 30 August 2005 15:01 Go to next message
Lcotto
Messages: 3
Registered: August 2005
Junior Member
I have run the script in the $ORACLE_HOME/bin directory and invoked the oratclsh interpreter which is a tcl interpreter from Oracle. It is returning the wrong result, see below:

oratclsh[1]- set err [catch {exec magic "agentctl stat"} text]
if { !$err && [string match "1
oratclsh2- *Agent is running*" $text] } {

# running
puts "<oramessage>YES</oramessage>"
puts "<oraresult>-1</oraresult>"
} else {
# not be running
puts "<oramessage>NO</oramessage>"
puts "<oraresult>2</oraresult>"
}
<oramessage>NO</oramessage> <oraresult>2</oraresult> oratclsh[3]-

The result of the agentctl stat is as follows:

tmefndr /oracle_home/app/oracle/product/9.2.0/bin> agentctl stat

DBSNMP for Solaris: Version 9.2.0.6.0 - Production on 30-AUG-2005 10:42:47

Copyright (c) 2003 Oracle Corporation. All rights reserved.

Version : DBSNMP for Solaris: Version 9.2.0.6.0 - Production Oracle Home : /oracle_home/app/oracle/product/9.2.0 Started by user : oracle Agent is running since 08/30/05 10:26:45---------------------------------> See - The Oracle agent is running tmefndr /oracle_home/app/oracle/product/9.2.0/bin>


What can be worng ?
Re: Help with TCL script [message #135418 is a reply to message #135282] Wed, 31 August 2005 09:04 Go to previous message
Lcotto
Messages: 3
Registered: August 2005
Junior Member
Also I want to say that the script that I'am trying to execute in the oratclsh (tcl interpreter) is the following:

[set err [catch {exec magic "agentctl stat"} text]
if { !$err && [string match "*is running since*" $text] } {
# running
puts "<oramessage>YES</oramessage>"
puts "<oraresult>-1</oraresult>"
} else {
# not be running
puts "<oramessage>NO</oramessage>"
puts "<oraresult>2</oraresult>"
}]

Previous Topic: having problem with creating OMS
Next Topic: unable to start my enterprise manager10G atabase control
Goto Forum:
  


Current Time: Mon May 23 23:59:23 CDT 2022