Edit D:\app\Administrator\product\11.2.0\dbhome_1\owb\lib\int\oracle\sysman\vtd\VtdEventGenerator.class
?? /? }? |? ??? ??? ?? ?? ??? ????? ? ? ?? ???? ? |? ? ?? ?? ??? ?? ? ??? "?? "? !? "??? ? 6?????? .? [???? .??? 6? |?? |? |? |?? 6? "??? @?? |???? F? |? |? |?? 9? 9? @? 6 9 9? | | U | 6 @ | | [ | | | ! |"#$ |%& U' U()* @+ 9,- . @/ @0 |1 |2 |3 |4 |5 |67 [89:;<=>?@ABCDEF @GH @IJ @KL @MN @OP @QR @STU @V [WXYZ[\] |^_`abc defghijklmnopqrstuvwxyz{|}~??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? @???? @? ? @ @ @ @ @ @ " @ @ @ @ @ @ " [ [ U [! [" [#$%&'() m_counter I m_msgCounter eventRegFile Ljava/io/FileOutputStream; msgIdFile msgFile imgIdFile imgFile events Ljava/util/Vector; m_service Loracle/sysman/vtd/VtdService; REQ_ARG_COUNT <init> ()V Code LineNumberTable main ([Ljava/lang/String;)V generateFiles (Ljava/util/Vector;)V Exceptions getEventsForClass (Loracle/sysman/vtd/VtdClass;)V openCartridgeFiles openMessageFiles openImageFiles closeCartridgeFiles genEvent &(Loracle/sysman/vtd/VtdBoundedEvent;)V addEventMsg addEventImg addEventReg genTcl genEventDesc genEventDef writeLine /(Ljava/io/FileOutputStream;Ljava/lang/String;)V 5(Ljava/io/FileOutputStream;Ljava/lang/StringBuffer;)V getTypeStr ()Ljava/lang/String; up &(Ljava/lang/String;)Ljava/lang/String; <clinit> SourceFile VtdEventGenerator.java???*+, ?sage: > java -DORACLE_HOME=<OHOME> oracle.sysman.vtd.VtdEventGenerator <DGHost> <ServiceName> <CartridgeId> <TargetType> <Credential...>-./ ? e.g.: > java -DORACLE_HOME=<OHOME> oracle.sysman.vtd.VtdEventGenerator CONMAC DB.WORLD ODB oracle_sysman_database system manager db.world01234567 TRC,MSG89/ Creating session... oracle/sysman/vtd/VtdSession oracle/sysman/vtp/VtpCp:;?< Creating service...=>? SVCTYPE is NULL!!! oracle/sysman/vtd/VtdService?@??ABCD/E2F/ NONEGH Attempting DG connection...IJKL oracle/sysman/vtd/VtdException java/lang/StringBuffer DG Connect ERROR: MNO? Not connected. Getting cartridges...PQRSTULVW oracle/sysman/vtd/VtdCartridgeX?YZ Error locating cartridge ) through specified target/DG combination. Getting classes...[Q Getting events... java/util/Vector?? oracle/sysman/vtd/VtdClass??~? 'Total Events Obtained From Cartridge = \]M^ !oracle/sysman/vtd/VtdBoundedEvent * _? Generating output files...?? File generation complete. java/lang/Exception 5ERROR: an error has occurred generating output files.`??????? Checking for events in class: aQb?cdeL???? java/io/FileOutputStream $.\output\OMSRegistry.registry_append?/??fghi java/lang/String .\output\Vtcet???? MsgID.java?? package oracle.sysman.resources;?? public interface Vtcet MsgID { / public static final String facility = "Vtcet "; Msg.java?? public class Vtcet 9Msg extends java.util.ListResourceBundle implements Vtcet # public Object[][] getContents() { return contents; } & static final Object[][] contents = ImgID.java?? ImgID Img.java?? 9Img extends java.util.ListResourceBundle implements Vtcetj?k? } };lmnQ oracle/sysman/vtd/VtdResourceX]o]pq???????????? public static final String r? _EVENT _DISPNAME = " _DESC = " _INSTANCE = " _ALERT_THRESHOLD = " _WARNING_THRESHOLD = " _ALERT_RESULT = " _WARNING_RESULT = " _NUM_OCCURENCES = " { _DISPNAME, " " }, _DESC, "s? _INSTANCE, "t? _ALERT_THRESHOLD, "u? _WARNING_THRESHOLD, "v? _ALERT_RESULT, "w? _WARNING_RESULT, "x? _NUM_OCCURENCES, "y? _ICON = " _ICON, "z?{? )/com/oracle/sysman/em/event_tests/oracle_ _ event /name = oracle/ /?? E/descriptor_class = oracle.sysman.vtcConsole.vtcEvent.vtceTests.Vtcet Event Descriptor ?/task_class = oracle.sysman.emSDK.common.tasks.BoundedEventTest /targets = |? .\output\ .tcl oradefine event /oracle/ description=VOC-01271 \ report=VOC-01272 @oraarguments target_type credentials data_item instances options /oravardesc target_type string message=VOC-01275 /oravardesc credentials string message=VOC-01275 -oravardesc data_item string message=VOC-01275 -oravardesc instances string message=VOC-01275 +oravardesc options string message=VOC-01275 oradefine end # Initialize global variables set output "" set occurence 0 ## The main event checking functions proc EvalEvent {} { ! # Declare globals we will use , global argv last_report output occurence E global SCRIPT_FAIL CLEAR_EVENT NO_EVENT WARNING_EVENT ALERT_EVENT global oramsg + # initialize the return code and output set ret_code $CLEAR_EVENT set output "" 0 ORATCL_DEBUG "Entering dgevent : [oratime] " 5 ORATCL_DEBUG " target_type [lindex $argv 0] " 5 ORATCL_DEBUG " credentials [lindex $argv 1] " 5 ORATCL_DEBUG " data_item [lindex $argv 2] " 5 ORATCL_DEBUG " instances [lindex $argv 3] " 5 ORATCL_DEBUG " options [lindex $argv 4] " $ set target_type [lindex $argv 0] $ set credentials [lindex $argv 1] # break up data_item 0 set cartridge_id [lindex [lindex $argv 2] 0] , set class_id [lindex [lindex $argv 2] 1] / set resource_id [lindex [lindex $argv 2] 2] . set comparator [lindex [lindex $argv 2] 3] - ORATCL_DEBUG " cartridge = $cartridge_id" ) ORATCL_DEBUG " class = $class_id" , ORATCL_DEBUG " resource = $resource_id" + ORATCL_DEBUG " comparator= $comparator" # break up instance list 4 set wildcard_instance [lindex [lindex $argv 3] 0 2 set instance_count [lindex [lindex $argv 3] 1] , set instance [lindex [lindex $argv 3] 2] ) ORATCL_DEBUG " instance = $instance" # break options 0 set warning_used [lindex [lindex $argv 4] 0] 5 set warning_threshold [lindex [lindex $argv 4] 1] . set alert_used [lindex [lindex $argv 4] 2] 3 set alert_threshold [lindex [lindex $argv 4] 3] 2 set num_occur_used [lindex [lindex $argv 4] 4] - set num_occur [lindex [lindex $argv 4] 5] 0 ORATCL_DEBUG " alert = $alert_threshold" 2 ORATCL_DEBUG " warning = $warning_threshold" * ORATCL_DEBUG " numoccur = $num_occur" # # issue command to get the data i ORATCL_DEBUG "dgevent : [oratime] oradggetdata <cred> $cartridge_id $class_id $resource_id $instance" ? if { [catch {oradggetdata [concat $credentials $oramsg(oraobject)] $cartridge_id $class_id $resource_id $instance} event_data] } { L if {$event_data == "unable to retrieve data from Data Gatherer." } { # # no data available yet D ORATCL_DEBUG "dgevent : [oratime] no data available yet" return $NO_EVENT } else { 8 # something bad happened K lappend output [format [msgtxt [NETWORK] nms 1005] dgevent.tcl] 6 lappend output [msgtxt [NETWORK] nms 1078] / if {$last_report == $SCRIPT_FAIL} { N ORATCL_DEBUG "dgevent : [oratime] last report = script_fail 2" return $NO_EVENT } else { , set last_report $SCRIPT_FAIL R ORATCL_DEBUG "dgevent : [oratime] set last report = script_fail 2" # return $SCRIPT_FAIL } } + # Check for alert and warning threshold / set value [lindex [lindex $event_data 0] 0] # EQ if { $comparator == 0 } { ? if { $alert_used == 1 && $value == $alert_threshold } { 5 if { $occurence < [expr $num_occur-1] } { incr occurence ) set ret_code $ALERT_EVENT A ORATCL_DEBUG "dgevent : [oratime] setting alert " @ lappend output $instance $alert_threshold $value I } elseif { $warning_used == 1 && $value == $warning_threshold } { + set ret_code $WARNING_EVENT C ORATCL_DEBUG "dgevent : [oratime] setting warning " B lappend output $instance $warning_threshold $value # NE " } elseif { $comparator == 1} { ? if { $alert_used == 1 && $value != $alert_threshold } { I } elseif { $warning_used == 1 && $value != $warning_threshold } { # GT " } elseif { $comparator == 2} { > if { $alert_used == 1 && $value > $alert_threshold } { H } elseif { $warning_used == 1 && $value > $warning_threshold } { # GE " } elseif { $comparator == 3} { ? if { $alert_used == 1 && $value >= $alert_threshold } { I } elseif { $warning_used == 1 && $value >= $warning_threshold } { # LT " } elseif { $comparator == 4} { > if { $alert_used == 1 && $value < $alert_threshold } { H } elseif { $warning_used == 1 && $value < $warning_threshold } { # LE " } elseif { $comparator == 5} { ? if { $alert_used == 1 && $value <= $alert_threshold } { I } elseif { $warning_used == 1 && $value <= $warning_threshold } { } else { P ORATCL_DEBUG "dgevent : [oratime] comparator($comparator) not supported" ! set ret_code $SCRIPT_FAIL # return $ if {$last_report == $ret_code} { return $NO_EVENT \ ORATCL_DEBUG "dgevent : $oramsg(oraobject) [oratime] : MESSAGE - $ret_code, $output" ! set last_report $ret_code return $ret_code } Descriptor.java 5package oracle.sysman.vtcConsole.vtcEvent.vtceTests; "import oracle.sysman.resources.*; 2Descriptor extends VtcetBoundedEventTestDescriptor // Event Descriptor: public Vtcet Descriptor() super ( Vtcet MsgID.facility, MsgID. _DISPNAME, _DESC, _WARNING_RESULT, _ALERT_RESULT, ImgID. _ICON, = "oracle.sysman.vtcConsole.vtcEvent.vtceTests.Vtcet " ); .java extends VtcetBoundedEventTest // Event Definition: () " ", // service type ", // cartridge identifier ", // event identifier }] , // class id ( ) , // resource id (~?? , // resource data type?? , // comparator?] , // default frequency???? , // alert default??M? , // alert minimum?? , // alert maximum?? , // warning default?? , // warning minimum?? , // warning maximum?? , // number of occurences?? , // instance select flag _INSTANCE, _ALERT_THRESHOLD, _WARNING_THRESHOLD, _NUM_OCCURENCES, 9 false, // allow wildcard instances list 3 false // allow proxy DG location???????Z?]?? node host database rdbms #oracle/sysman/vtd/VtdEventGenerator java/lang/Object java/lang/System out Ljava/io/PrintStream; java/io/PrintStream println (Ljava/lang/String;)V oracle/sysman/vtd/VtdConsole exit (I)V oracle/sysman/vtd/Vtd VP_KEEP_THREAD_COUNT oracle/sysman/vtd/VtdMessageBox SHOW_DIALOG Z oracle/sysman/vtd/VtdRegistry initOptions getAppContext +()Loracle/sysman/vtd/guiUtil/VtdAppContext; ,(Loracle/sysman/vtd/guiUtil/VtdAppContext;)V oracle/sysman/vtd/VtdServiceType getServiceType 6(Ljava/lang/String;)Loracle/sysman/vtd/VtdServiceType; U(Loracle/sysman/vtd/VtdSession;Ljava/lang/String;Loracle/sysman/vtd/VtdServiceType;)V getConnectInfo &()Loracle/sysman/vtd/VtdDGConnectInfo; "oracle/sysman/vtd/VtdDGConnectInfo setDGHost setDGPort setCredential setSession !(Loracle/sysman/vtd/VtdSession;)V getDataGatherer %()Loracle/sysman/vtd/VtdDataGatherer; Connected ()Z append ,(Ljava/lang/String;)Ljava/lang/StringBuffer; toString getCartridges ()Ljava/util/Vector; elements ()Ljava/util/Enumeration; java/util/Enumeration hasMoreElements nextElement ()Ljava/lang/Object; getId compareTo (Ljava/lang/String;)I getClasses size ()I (I)Ljava/lang/StringBuffer; getLabel printStackTrace getEvents setClassV addElement (Ljava/lang/Object;)V isEndNode elementAt (I)Ljava/lang/Object; getCartridge "()Loracle/sysman/vtd/VtdCartridge; flush close getClassV ()Loracle/sysman/vtd/VtdClass; getResources getResourceId setResource "(Loracle/sysman/vtd/VtdResource;)V toUpperCase getDesc getInstanceLabel getAlertThresholdPrompt getWarningThresholdPrompt getAlertText getWarningText getNumOccurencesPrompt getIconFilename toLowerCase getType getClassId getResource !()Loracle/sysman/vtd/VtdResource; getDataTypeString getComparatorString getDefaultFrequency getAlertDefault !()Loracle/sysman/vtd/VtdDataItem; getThresholdStr 3(Loracle/sysman/vtd/VtdDataItem;)Ljava/lang/String; getAlertMinimum ()D (D)Ljava/lang/StringBuffer; getAlertMaximum getWarningDefault getWarningMinimum getWarningMaximum getNumOccurrencesStr getInstSelFlagStr (Ljava/lang/StringBuffer;)V getBytes ()[B write ([B)V indexOf length substring (II)Ljava/lang/String; !|} ~ ? ?? ?? ?? ?? ?? ?? ?? ? ?? ? *? ? ? % ?? ? ? f*? ? ? ? ? ? ? *2L*2M*2N*2:6? ? ? ? ? ? Y? Y? ? ? :? ? ? :? ? ? ? Y,? ? ? ? +? ? ? ? *?? 6*? !? ? *2? ??? ? ? ? ? 6? ? ? ? ? ? ? ? 6? 6? ": ? ? "Y? #$? % ? &? %? '? ? ? (? ? ? )? ? ? *: : ? +:? , ? "? - ? .:? /-? 0??: ? ? %? ? "Y? #1? %-? %2? %? '? ? ? 3? ? 4:? 5? ? 6Y? 7? 8? +:? , ? ? - ? 9: ? :??? ;? <? ? "Y? #=? %? 8? >? ?? '? ? 8? +:? , ? /? - ? @: ? ? "Y? #A? % ? B? %? '? ?? C? ? 8? D? E? ? :? G? ? H? ? ? ? ! ?SV F ? G = ? A C F G $ H ( I - J 2 L 6 O : Q ? U G W Z [ b ^ i a n c v f ? h ? i ? k ? m ? o ? m ? t ? w ? z ? ~ ? ? ? ? ? ? ? ? ? ? ? ? ? ?% ?) ?1 ?9 ?<