EEM CLI Script with parameters

Hi all,
I have a requirement to write an eem cli script that can be triggered using a pattern match and take parameters.
Basically the user has to do many repetitive tasks reconfiguring interfaces regularly. So instead of having to go into each interface individually and run the config that they can write a one word command and give it params which would be for example a comma separated list of interface names and then within my script i could parse the interface names and iterate over them performing the config operation on them.
so i'm just playing around with the cli policy.
::cisco::eem::event_register_cli occurs 1 pattern "nacdrop*" sync yes enter
# Import Namespaces
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
array set arr_einfo [event_reqinfo]
set full_command $arr_einfo(msg)
puts $full_command
You can see here i want the command nacdrop to trigger this policy but when i try and run the command with arguments i get an error on the command line as its not a valid command and the policy doesnt trigger.
Ideal scenario run command
Router#nacdrop fastEthernet0/0,fastEthernet0/1,fastEthernet0/2
the script would then perform a set of config tasks on each of the 3 interfaces.
I thought the "enter" parameter to event_register_cli would do it as that is supposed to trigger the policy before the command is executed therefore before it determines it to be an invalid command. I do not have the latest version of eem however and suspect that the "enter" argument isn't being used as it isn't showing up as an option when i type ? to see what options are available although i don't get an error when registering the policy.
So my question is what version off eem was this "enter" argument introduced and will it allow me to run the policy and get around the invalid command problem.
Once i can run this policy and access the parameters to the cli command it opens up a lot for me in terms of automating repetitive tasks.
Hope someone can help.
Cheers,
Joe.

Cheer Joe. That's great. I've attached the first draft of a script i've written, maybe someone else can find it useful too.
Basically it's for if you would like to perform the same operation on many interfaces you can use an alias and give it parameters
E.G
Router#vlanmove FastEthernet0/1-8,10,13-16
Notice the params use '-' and ',' When you use dash it will perform the operation on all the interfaces in a range and then comma is just for an individual interface and as you can see above you can mix ranges with individual ones.
The above example will give the output:
Configuring Interface: FastEthernet0/1
Configuring Interface: FastEthernet0/2
Configuring Interface: FastEthernet0/3
Configuring Interface: FastEthernet0/4
Configuring Interface: FastEthernet0/5
Configuring Interface: FastEthernet0/6
Configuring Interface: FastEthernet0/7
Configuring Interface: FastEthernet0/8
Configuring Interface: FastEthernet0/10
Configuring Interface: FastEthernet0/13
Configuring Interface: FastEthernet0/14
Configuring Interface: FastEthernet0/15
Configuring Interface: FastEthernet0/16
in the attached script just replace "puts "Configuring Interface: $interfaceName"
with your configuration
e.g.
conf t
interface $interfaceName
switchport access vlan 2
and it will perform that operation on all intefaces in a range. I might update the script later to take config commands as env variables too. That would make the script more generic. But at the moment this script is useful for us as we have to regularly reconfigure interfaces.
Cheers,
Joe.

Similar Messages

  • What is the best way to run a powershell script with parameters in the Task Scheduler?

    Hello, 
    Want to run the following from a scheduled task in the Task Scheduler on a server.  What is the best approach?
    .\pscript.ps1 -csvfile "\\Srv1\Share\File.txt"
    Thanks for your help! SdeDot

    Hi,
    To run a powershell script with parameters in the Task Scheduler:
    Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Add argument (optional): -Command "& c:\scripts\test.ps1 -par1 2 -par2 3"
    Hope the below two articles be helpful for you:
    Schedule PowerShell Scripts that Require Input Values
    https://blogs.technet.com/b/heyscriptingguy/archive/2011/01/12/schedule-powershell-scripts-that-require-input-values.aspx
    How to Schedule a PowerShell Script
    http://dmitrysotnikov.wordpress.com/2011/02/03/how-to-schedule-a-powershell-script/
    Regards,
    Yan Li
    Regards, Yan Li

  • How to compile and execute a Jython script with parameters (?)

    I am writing a scripting extension mechanism for a big server project we've built over the last year and a half.
    What I want to acheive is:
    - system authors upload scripts (via a web front end)
    - the system checks and compiles the script
    - stashes the compiled script away against a named event.
    When the event occurs the compiled script is called by the server with a list of parameters (current user id, various numbers describing the system state).
    Now I can upload and compile the script just fine using :
    PyCode somePyCode = __builtin__.compile ( script, "<>", "exec");
    ...and deal with any errors ...and stash the script away against a named event...etc.
    And it is easy enough to call this code with
    aPythonInterpreterInstance.exec ( somePyCode );
    but that doesn't pass my parameters through.
    It seems to me there's three obvious ways to do this:
    (1) specify that each script has a named target:
    def onEvent(eventid , userid):
    ... and use one of the PyCode.call() methods
    - but these aren't sensibly documented in the javadocs so it could take a while to figure out what's really going on.
    (2) specify that each script contains a class def and implements a __call__ method - but I can't see how to get the PyClass object out of the PyCode object returned by __builtin__.compile
    (3) put the variables into the local namespace and then execute the script (without a named method or class) - but this means that I would have to clean down the local namespace each time (- and anyway what is it local to?).
    (Did I mention execution speed is important to this app and I need to service multiple threads?)
    Thanks in advance,
    Tony
    ps. hope this isn't o/t to you.

    Some days you just know the synapses aren't talking.
    Of course when you exec() py code with def'd functions and class definitions in you're not executing the function(s) but defining them. Meaning that my question was all back to front in the first place.
    All four copies.

  • [shellscript] Passing a script with parameters to AT

    Hey everybody,
    I would like to learn shell scripting so I created a script to mount/unmount my truecrypt volume. This is what I have so far:
    #!/bin/bash
    case "$1" in
    start)
    truecrypt -k '' /dev/array/vault /home/<user>/vault
    stop)
    truecrypt -d /home/<user>/vault
    echo "usage: $0 (start|stop)"
    esac
    exit 0
    Now I would like to add another feature. I want it to automatically unmount after 2 hours. I found the "at" command which should be able to do this.
    I would need to do something like:
    start)
    truecrypt -k '' /dev/array/vault /home/<user>/vault
    at -f "$1 stop" now + 2 hours
    However, running just " at -f "./vault.sh start" now + 2 minutes " fails:
    warning: commands will be executed using /bin/sh
    Cannot open input file ./vault.sh start: No such file or directory
    If I can get this working I would like the "stop" code to remove any scheduled stop operations (for when I do it manually).  Also, I would like to include a "keepalive" function that allows me to kill the scheduled stop task and reschedule it again to restart the countdown. This would allow me to keep the volume mounted if I want to use it for a longer period of time.
    Is it possible to execute scripts + parameters with "at"?  Can somebody help me to make this work?
    Thanks a bunch!
    P.S: Truecrypt also keeps asking me this:
    Protect hidden volume (if any)? (y=Yes/n=No) [No]:
    I would like to specify this in the command so that I don't have to hit enter every time. I've looked at the man page but found nothing helpfull. Anyone?

    Make sure that vault.sh exists in the directory that you are executing it from. It may be better to refer to the whole file location rather than just './'. eg use " at -f "~/vault.sh start" now + 2 minutes " rather than just  " at -f "./vault.sh start" now + 2 minutes ".
    Providing thatyou are happy for TrueCrypt to accept the default answer for any questions it asks you can just pipe yes into it:
    yes | truecrypt -k '' /dev/array/vault ~/vault
    Yes will 'press enter' to any questions that TrueCrypt asks.
    Last edited by gadget3000 (2011-07-14 16:46:01)

  • How to create OMPplus script with parameters

    Hi all. I am trying to parameterize my OMB scripts. For now I am only able to pass one type of parameter, For example in the script below I can parameterize the mapping name. So even If I pass 3 mapping names I will import MDX files and deploy for all 3 mappings.
    I want to improve this and I want to pass other parameters such as passwords and schema names also. How would I be able to do that? How can I pass different type of parameters such as schema name, password and mapping name and reference to them separately from the script?
    set MAPLIST $argv
    OMBCONOMBCONNECT DWPROD/DWPROD@cakir:1521:orcl USE REPOSITORY 'OWBDB_SYS'OMBCC 'MY_PROJECT'
    OMBCONNECT CONTROL_CENTER
    OMBCOMMIT
    foreach mapName $MAPLIST {
    OMBIMPORT MDL_FILE 'C:/tfsroot2/Interfaces and Extracts/branches/Interfaces and Extracts1.1/000 - OWB Prototype/deploy/ora.stg/mappings/$mapName.mdx' USE UPDATE_MODE MATCH_BY NAMES OUTPUT LOG TO 'C:/tfsroot2/Interfaces and Extracts/branches/Interfaces and Extracts1.1/000 - OWB Prototype/deploy/ora.stg/mappings/$mapName.log'
    OMBCOMMIT
    OMBALTER LOCATION 'XTRCT_DWEXTRACT_LOC' SET PROPERTIES (PASSWORD) VALUES ('PASSWORD')
    OMBALTER ORACLE_MODULE 'XTRCT_DWEXTRACT' ADD REFERENCE LOCATION 'XTRCT_DWEXTRACT_LOC' SET AS DEFAULT
    OMBALTER ORACLE_MODULE 'XTRCT_DWEXTRACT' SET PROPERTIES (DB_LOCATION) VALUES ('XTRCT_DWEXTRACT_LOC')
    OMBCOMMIT
    OMBALTER LOCATION 'XTRCT_DWPROD_LOC' SET PROPERTIES (PASSWORD) VALUES ('PASSWORD')
    OMBALTER ORACLE_MODULE 'XTRCT_DWPROD' ADD REFERENCE LOCATION 'XTRCT_DWPROD_LOC' SET AS DEFAULT
    OMBALTER ORACLE_MODULE 'XTRCT_DWPROD' SET PROPERTIES (DB_LOCATION) VALUES ('XTRCT_DWPROD_LOC')
    OMBCOMMIT
    OMBREGISTER LOCATION 'XTRCT_DWEXTRACT_LOC'
    OMBCOMMIT
    OMBREGISTER LOCATION 'XTRCT_DWPROD_LOC'
    OMBCOMMIT
    OMBREGISTER LOCATION 'DWEXTRACT_INPUT'
    OMBCOMMIT
    OMBREGISTER LOCATION 'DWEXTRACT_OUTPUT'
    OMBCOMMIT
    OMBCC 'XTRCT_DWEXTRACT'
    foreach mapName $MAPLIST {
    OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN '$mapName' ADD ACTION 'MAPPING_DEPLOY' SET PROPERTIES (OPERATION) VALUES ('CREATE') SET REFERENCE MAPPING '$mapName'
    OMBDEPLOY DEPLOYMENT_ACTION_PLAN '$mapName'
    OMBDROP DEPLOYMENT_ACTION_PLAN '$mapName'
    OMBCOMMIT
    puts "Mapping $mapName deployed"
    OMBDISCONNECT

    Maybe you can try putting this variable list of parameters in a text file and read the text file. You pass the path/name of the text file as a variable:
    proc read_file { p_file } {
    # Validate file exists
    if { [ file exists $p_file ] } {
    puts "File: $p_file exists"
    } else {
    puts "ERROR, not exists: $p_file"
    return 1
    # open file to read
    set v_openfile [ open "$p_file" ]
    set data_file [ read -nonewline $v_openfile ]
    close $v_openfile
    # read each line in file
    set v_list_line [ split $data_file \n ]
    foreach v_line $v_list_line {
    Regards
    ANA GH

  • Help with EEM TCL / CLI scripting for re-direction/wccp counters

    Being new with EEM scripting I wanted to see if I was on the right track and get some help to finish my idea.
    Our problem I am trying to fix is our remote sites utilize pairs of Cat3650's for some routing and WCCP redirection.  We are encountering ACL denial issues causing slow down and access issues.  The fix for the issue we remove the WCCP service groups to break peering with our wan optimizers and re-insert the configuration thus re-establishing peering and restoring service.
    My idea is to use a TCL scipt on a watchdog timer to parse the "sh ip wccp | inc denied (or unassign)" output for denial and unassignable error counters.  If a counter is found I wanted to create a syslog message that would then kick off a simple EEM CLI script to remove the service groups, wait 10 seconds, then re-add the service groups.  Please point me in the right direction if I am off track as I am not sure if I can use the EEM CLI for all this or since I want to retreive specific info from the sh ip wccp output if I do need to utilize TCL.  I am also unsure if the "total denied" ascii string pulled via the "sh ip wccp | inc denied" will cause issues when attempting to just pull the counter information.
    sh ip wccp | inc Denied Red
            Total Packets Denied Redirect:       0
            Total Packets Denied Redirect:       0
    Script thus far :
    TCL
    if [catch {context_retrieve "EEM_WCCP_ERROR_COUNTER" "count"} result] {
    set wccpcounter 0
    } else {
    set wccpcounter $result
    } if [catch {cli_open} result] {
    error $result
    } else {
    array set cli $result
    } if [catch {cli_exec $cli(fd) "show ip wccp | incl Denied"} result] {
    error $result
    } else {
    set cmd_output $result
    set count ""
    catch [regexp {receive ([0-9]+),} $cmd_output} ignore count]
    set count
    set diff [expr $count - $wccpcounter]
    if {$diff != 0} {
    action_syslog priority emergencies msg "WCCP counters showing incremental Denied packet counts"
    if [catch {cli_close $cli(fd) $cli(tty_id)} result] {
    error $result
    context_save EEM_WCCP_ERROR_COUNTER count
    CLI
    event manager applet WCCP_COUNTER_WATCH
    event syslog priority emergencies pattern "WCCP counters showing incremental Denied packet counts"
    action 001 cli command "enable"
    action 002 cli command "config t"
    action 003 cli command "no ip wccp 61"
    action 004 cli command "no ip wccp 62"
    action 005 wait 10
    action 006 cli command "ip wccp 61"
    action 007 cli command "ip wccp 62"
    action 008 wait 15
    action 009 cli command "clear ip wccp"
    action 010 cli command "end"
    Thanks for all the help

    This won't work as EEM cannot intercept its own syslog messages.  However, I'm not sure why you need this form of IPC anyway.  Why not just make the Tcl script perform the needed CLI commands?
    And, yes, you could use all applets here.  But since you've written the hard stuff in Tcl already, it might be best just to add the missing calls to reconfigure WCCP to that script.

  • EEM TCL script configuration issue

    Hi Experts,
    I need help with an EEM TCL script for the CRS platform that generates a SYSLOG message after the CPU reaches a threshold value and then stays over the threshold value for 15 minutes, I've already tryied several thing and the last TCL script that I tested generated the SYSLOG message when the CPU reaches the threshold but I can't seem to find any way to make it wait the 15 min over the threshold and then generate the message.
    My current script looks like this:
    ::cisco::eem::event_register_wdsysmon timewin 900 sub1 cpu_tot op ge val 70
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    array set event_details [event_reqinfo]
    action_syslog msg "sub1 is $event_details(sub1)"
    action_syslog msg "High CPU threshold value over 70%"
    puts ok
    I've tryied using the 'period' option for the 'cpu_tot' variable but the TCL script was'nt recognized and couldn't be registered, and I'm using the 'timewin' option here but it seems to be wrong as it says it's the time it has for multiple sub-events to ocurr in order for the script to execute.
    timewin
    (Optional) Time window within which all of the subevents have to occur in order for an event to be generated and is specified in SSSSSSSSSS[.MMM] format. SSSSSSSSSS format must be an integer representing seconds between 0 and 4294967295 inclusive. MMM format must be an integer representing milliseconds between 0 and 999).
    Also, the 'period' option I believe wouldn't have worked because I understand that it referrs to the time period that the script will take to monitor the CPU:
    •1. cpu_tot [op gt|ge|eq|ne|lt|le] [val ?] [period ?]
    op
    (Optional) Comparison operator that is used to compare the collected total system CPU usage sample percentage with the specified percentage value. If true, an event is raised.
    val
    (Optional) Percentage value in which the average CPU usage during the sample period is compared.
    period
    (Optional) Time period for averaging the collection of samples and is specified in SSSSSSSSSS[.MMM] format. SSSSSSSSSS format must be an integer representing seconds between 0 and 4294967295, inclusive. MMM format must be an integer representing milliseconds between 0 and 999. If this argument is not specified, the most recent sample is used.
    As I said, I couldn't try this because the script send an error when I tried to register using the following line:
    ::cisco::eem::event_register_wdsysmon sub1 cpu_tot op ge val 70 period 900
    This is the error message that appeared:
    RP/0/RP0/CPU0:CRS(config)#event manager policy test.tcl username cisco
    RP/0/RP0/CPU0:CRS(config)#commit
    Thu Aug 29 12:35:43.569 CDT
    % Failed to commit one or more configuration items during a pseudo-atomic operation. All changes made have been reverted. Please issue 'show configuration failed' from this session to view the errors
    RP/0/RP0/CPU0:CRS(config)#sh conf fail
    Thu Aug 29 12:35:52.427 CDT
    !! SEMANTIC ERRORS: This configuration was rejected by
    !! the system due to semantic errors. The individual
    !! errors with each failed configuration command can be
    !! found below.
    event manager policy test.tcl username cisco persist-time 3600
    !!% Embedded Event Manager configuration: failed to retrieve intermediate registration result for policy test.tcl
    end
    Anyway, to make this work I understand that I need nested TCL scripts that do the following:
    •1. Monitor the CPU and when it reaches the threshold install another TCL policy that counts down 15 min.
    •2. If the second TCL policy reaches zero then it should generate the SYSLOG message.
    •3. Monitor the CPU while this is running and if it falls below the threshold it should stop the second TCL policy.
    I don't know how I can acomplish this so if anyone can help me with this or show me another way to do this I would really appreciate it.
    Thanks in advance for all your help!

    Neither option is likely to do what you want.  The timewin is for correlating multiple events, and period is the polling interval.  What you want is to create a timer when the CPU is first detected as being high, countdown 15 minutes, then alert you.  You can do this with a nested EEM policy.  For example, you can add the following to your existing policy:
    proc get_pol_dir { fd } {
        set res {}
        set output [cli_exec $fd "show event manager directory user policy"]
        set output [string trim $output]
        regsub -all "\r\n" $output "\n" result
        set lines [split $result "\n"]
        foreach line $lines {
            if { $line == "" } {
                continue
            if { ! [regexp {\s} $line] && ! [regexp {#$} $line] } {
                set res $line
                break
        if { $res == {} } {
            return -code error "The user policy directory has not been configured"
        return $res
    if { [catch {cli_open} result] } {
        error $result $errorInfo
    array set cli $result
    set output [cli_exec $cli(fd) "show event manager policy registered | inc tm_alert_high_cpu.tcl"]
    if { [regexp {tm_alert_high_cpu.tcl} $output] } {
        exit 0
    set poldir [get_pol_dir $cli(fd)]
    set polname "${poldir}/tm_alert_high_cpu.tcl"
    set fd [open $polname "w"]
    puts $fd "::cisco::eem::event_register_timer countdown time 900"
    puts $fd "namespace import ::cisco::eem::*"
    puts $fd "namespace import ::cisco::lib::*"
    puts $fd "action_syslog msg \"CPU has been over 70% for 15 minutes\""
    close $fd
    cli_exec $cli(fd) "config t"
    cli_exec $cli(fd) "event manager policy tm_lert_high_cpu.tcl username eem"
    cli_exec $cli(fd) "commit"
    cli_exec $cli(fd) "end"
    catch {cli_close $cli(fd) $cli(tty_id)}
    Additionally, you'll want another permanently configured policy that checks for a low CPU threshold.  Something like:
    ::cisco::eem::event_register_wdsysmon sub1 cpu_tot op le val 10
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    if { [catch {cli_open} result] } {
        error $result $errorInfo
    array set cli $result
    cli_exec $cli(fd) "config t"
    cli_exec $cli(fd) "no event manager policy tm_alert_high_cpu.tcl"
    cli_exec $cli(fd) "commit"
    cli_exec $cli(fd) "end"
    catch {cli_close $cli(fd) $cli(tty_id)}

  • EEM-TCL Script to switch config from interface X to interface Y

    Hello Guys,
    I’m trying to create a script which is controlled by an EEM-UPDOWN event of an interface. What I’m trying to do is, if interface X is down for some reason it should copy the interface configuration to interface Y.
    So my problem is I’m very new to eem-tcl scripting and I have some basic problem hopefully u can help me =) I’m working on a ASR9K !
    So what i have done so fare:
    ::cisco::eem::event_register_syslog occurs 1 pattern ".*CHANGED.*$_sat_1_link_1.*" maxrun 90   
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    array set arr_einfo [event_reqinfo]
    if {$_cerrno != 0} {
        set result [format "component=%s; subsys err=%s; posix err=%s;\n%s" \
          $_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str]
        error $result
    if [catch {cli_open} result] {
        error $result $errorInfo
    } else {
        array set cli1 $result
    action_syslog priority emergencies msg "start script testv1_1"
    #puts "\nEXECUTE CLI COMAND :\n"
    set out {cli_exec $cli1(fd) "show running-config formal interface $_sat_1_link_1"}
    set xout [split $out \n]
    #puts "DEBUG : $xout \n\n"
    set anz [llength $xout]
    #puts "DEBUG : count rows = $anz \n\n"
    for {set ii "0"}  {$ii < $anz } {incr ii} {
           set indexout [lindex $out $ii]
        regexp  {([\w]+)[ ]([\w\d/]+)\s(.*)} $indexout a b c d
        #puts "\nDEBUG START"
        #puts "\nindex Nr  $ii"
        #puts "Full Match: $a"
        #puts "Sub Match1: $b"
        #puts "Sub Match2: $c"
        #puts "Sub Match3: $d"
        #puts "DEBUG END\n"
        set intsrc {cli_exec $cli1(fd) "no $b $_sat_1_link_1 $d"}
        set intdest {cli_exec $cli1(fd) "$b $_sat_1_link_2 $d"}
    if [catch {cli_exec $cli1(fd) "commit"} result] {
        error $result $errorInfo
    if [catch {cli_exec $cli1(fd) "end"} result] {
        error $result $errorInfo
    action_syslog priority emergencies msg "End script testv1_1"
    ps. $_sat_1_link_1 and $_sat_1_link_2 are globaly set per cli in the event manager env.
    Thanks for your help and hopefully u can help me with this script

    Hey
    after show running-config formal interface TenGigE 0/0/2/1 the cli output example is :
    interface TenGigE0/0/2/1 description Test: 0-43
    interface TenGigE0/0/2/1
    interface TenGigE0/0/2/1 shutdown
    and now i want to split the config with my regex
    regexp  {([\w]+)[ ]([\w\d/]+)\s(.*)} $indexout a b c d
    As example line 1
    set x= "TenGigE0/0/2/2"                  --> =dest_interface
    a= interface TenGigE0/0/2/1 description Test: 0-43
    b= interface
    c= TenGigE0/0/2/1
    d= description Test: 0-43
    do this
    cli_exec $cli1(fd) "no $b $c $d"      --->no interface TenGig E0/0/2/1 description Test: 0-43
    cli_exec $cli1(fd) " $b $x $d"          ---> interface TenGigE0/0/2/2 description Test: 0-43
    and from this point it shoud do this until there are no config lines  =)
    as a final result is should copy the whole config from interface X to interface Y  if the trigger is active
    but as i see, the main problem is to get the CLI output in a format like this
    set xy = interface TenGigE0/0/2/1 description Test: 0-43\ninterface TenGigE0/0/2/1\ninterface TenGigE0/0/2/1 shutdown
    or in an index like this:
    Index | command
    1         interface TenGigE0/0/2/1 description Test: 0-43
    2         interface TenGigE0/0/2/1
    3         interface TenGigE0/0/2/1 shutdown
    Thx

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

  • ECATT Script with SAPGUI Commando works in consolidation but not in prod.

    Hi experts,
    I created a eCATT script with commando SAPGUI Rec. In our consolidation system it works fine but when I try to let it run in production it is not working. User scripting is enabled (in options and in rz11). I am starting the script, the production system is getting opened but afterwards there happens nothing anymore. Also the scriptingsign in the bottom right corner is not active.
    When I am running a script with TCD Rec, it works fine in production. Is there a difference between settings for scripting for TCD Rec and SAPGUI scripting? Do you have any idea which kind of influences there could be that make this difference between TCD Rec and SAPGUI Rec scripts?
    Best regards and thank you in advance!
    Jan

    Hello,
    Ideally we should not run the ecatts in the production system as this would hamper the system environment or change systems.
    Also check in RZ11 enter sapgui/user_scripting , here the values for the last three parameters are set to TRUE.
    Thanks & Best regards,
    Ajay

  • Calling an rss script with rs.exe fails to result in a report pdf from VB6 w/ ShellEx.

    Sql 2008 R2
    Calling an rss script with rs.exe fails to result in a report pdf from VB6 w/ ShellEx. 
    If I call rs.exe with the various parameters from the command prompt I  have success(other than rs.exe using the temp folder, which is a different issue).  But when I try to execute the same process from a Visual Basic 6.0 application utilizing
    the ShellEx api call, the report creation and output to PDF format do not occur.   There is no error raised.
    Yes, I wish I could use a newer dev tool but that isn't an option right now. I think this should work.  Can ya'll tell me what I'm doing wrong?
    sArgs = "-i " & Chr(34) & "'C:\Program Files\Dura Supreme\OrderEntry\RunOrdReports.rss'" & Chr(34) & _
    " -s 'http://walnut/reportserver' -v 'DuraOrderNum=" & _
    Chr(34) & sOrdDuraID & Chr(34) & "' -e Exec2005 -t"
    ShellEx Chr(34) & "C:\Program Files\Dura Supreme\OrderEntry\rs.exe" & Chr(34), EShellShowConstants.essSW_SHOWNORMAL, sArgs
    TIA,
    Jim M.

    ShellEx Chr(34) & "C:\Program Files\Dura Supreme\OrderEntry\rs.exe" & ....
    Hello Jim,
    The path for rs.exe includes spaces, you should set it in hyphen, as you already did for file "RunOrdReports.rss" in variable "sArgs2
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Data exchange Mainscript (SCRIPT) with script block (DAC)

    Is there any way to exchange data beetwen a Mainscript (SCRIPT) with
    user-dialoges and script block (DAC) in this way that the script in
    scriptblock can access to this data?
    Background: I write a DAC-Application with some script-blocks for
    reading and writing data to/from real devices. During the development
    I'd like to simulate all device accesses because I don'd have the
    devices in my office. I write all scripts with a branch for simulation
    an real measurement on startup.
    How can I execute a swich (simulation / mesurement) without changing
    all my scripts all times? Can a script read a variable anyway (Variable
    from Mainscript, Diadem-Uservariable or "Hilfsvariable" like L1)? 
    Can I fill "DeviceParam1V" with content of a variable?
    I could use a input channel connected with a formula-block for it. (The
    formula-block can read a variable.) But this way is uncomfortable an
    don't work for input blocks.
    Martin Bohm
    [email protected]

    Because the DAC Script is executed in its own runtime environment you cannot use the DIAdem variables as in a normal VBS or a SUD.
    Still, there are ways to exchange information.
    First of all by an extra channel as Input (you named it)
    Secondly, there are several variables you can use. Have a look at the Script DAC block. There are two fields called Parameter1 and Parameter2. And each signal you configure has a parameter of its own.
    Prior to starting the scheme, you can use a script to change the value of those parameters:
    Call DACObjOpen("Script-in1")
      VBSSignalParam(1) = "abc"
    Call DACObjClose("Script-in1")
    Is changing the parameter of the first signal that is configured.
    Call DACObjOpen("Script-in1")
      VBSParameter1 = "1st device parameter"
      VBSParameter2 = "2nd device parameter"
    Call DACObjClose("Script-in1")
    is changing the global device parameters.
    On the side of the Script DAC driver VBS you cann use the paramP funtion to access the signal parameter that corresponds to the actual channel (as referenced by ChannelnumberP)
    ' SFD_ReadChannel
    ' Zweck               : Lesen eines Wertes für den Kanal "ChannelNumberP"
    ' ChannelNumberP      | Kanalnummer aus dem Block-Dialog
    ' ParamP              | Vom Anwender definierte Variable aus dem Block-Dialog
    ' DataP               | Variable zur Rückgabe des neuen Kanalwertes. Diese
    '                     | Variable sollte zumindest auf einen gültigen Wert
    '                     | initialisiert werden.
    ' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
    '                     | Variable gesetzt, stoppt DIAdem die Messung
    Sub SFD_ReadChannel( ChannelNumberP, ParamP, DataP, ErrorP )
    End Sub
    To acces the device Parameters, use the init function:
    ' SFD_Init
    ' Zweck               : Diese Prozedur wird während des Messungsstarts aufgerufen
    ' DeviceParam1V       | Erster Parameter, der vom Anwender im DAC-Block
    '                     | eingegeben werden kann
    ' DeviceParam2V       | Zweiter Parameter, der vom Anwender im DAC-Block
    '                     | eingegeben werden kann
    ' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
    '                     | Variable gesetzt, stoppt DIAdem die Messung
    Sub SFD_Init( DeviceParam1V, DeviceParam2V, ErrorP )
    End Sub
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • View with parameters

    Hello,
    Can we create the view with the parameters? How to do that? We need to create the sql script with parameter for super user to query, instead of create sql script then we would like to create the view then user can select only view.
    Many thanks in advance. :-)

    Hi,
    Views using SYS_CONTEXT, as Justin mentioned, are perhaps the most common way to simulate parameterized views in Oracle.
    Another method is to use a table (usually a Global Temporary Table) to hold the parameters. The view can then join to the table, use it in scalar sub-queries, IN-sub-queries, etc.
    This is the best way if you need to use the same parameterized view two (or more) times in the same query, with different parameters each time.
    Edited by: Frank Kulash on Oct 10, 2008 4:04 PM
    Sorry, I meant to reply to OP.

  • RMAN scripts & variables/parameters

    Hi
    We are using RMAN with TSM. There are a number of 9i and 8i databases. I tried to set the environment up to with as few scripts as possible to cover the variety of databases. I provide various variables/parameters to handle the differences between the various databases.
    In the 9i environment I "CONFIGURE" as much as possible to avoid setting changes in the actual backup script. That gives me a fairly clean generic backup script which also avoids manual channel allocations ie :
    run
    backup incremental level=0
    not backed up since time='SYSDATE-(8/24)'
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    plus archivelog format '/ARC_%d_%T_%U' delete all input;
    However due to the lack of "CONFIGURE" in 8i I cannot configure automatic channels. Therefor my script has to change to :
    run
    allocate channel ch01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch04 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    backup incremental level=0
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    (archivelog all format '/ARC_%d_%T_%U' delete input);
    release channel ch01;
    release channel ch02;
    release channel ch03;
    release channel ch04;
    I have multiple database instances on the same server & would like to have a single generic script with a variable/parameter to change the "tdpo.opt" file for each instance. The alternate is to have a complete set of scripts for each DB instance with everything hard coded.
    The question is : Can I pass variables/parameters to a RMAN script? If yes, how do I go about it?
    Maybe there are other ideas out there to do this. The key to me in this whole execise is to reduce maintenance & increase flexibility.
    Your responses will be appreciated
    CM

    I was hoping to get away from building part of the backup script ie the channel allocation in the RMAN statement.Don't know how you expect to do this when it's required for 8i databases ?
    Well since you are looking to accommodate 8i & 9i database and you need to manually allocate channels for the 8i databases, then you could configure your script to include an IF..THEN block that will run one set of RUN commands if the database name that is passed in is in a certain list and run the other RUN block if it isn't. You could maintain two "here document" blocks, one for 8i and one for 9i. Therefore, all of the commands can reside in one generic script.
    For example, you could configure your single, generic script as:
    # add your logic checking here to see if a 9i database sid
    # was passed in as a parameter.  If so run the following code
    rman target / log=${sid}bkp_log append << !1
    run
    backup incremental level=0
    not backed up since time='SYSDATE-(8/24)'
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    plus archivelog format '/ARC_%d_%T_%U' delete all input;
    !1
    # if not run the following (ie. 8i databases)
    rman target / log=${sid}bkp_log append << !2
    run
    allocate channel ch01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch04 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    backup incremental level=0
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    (archivelog all format '/ARC_%d_%T_%U' delete input);
    release channel ch01;
    release channel ch02;
    release channel ch03;
    release channel ch04;
    !2then you could call this generic script with the appropriate command line parameters.
    Hope I'm following your explanation/requirement.

  • CONCSUB WITH PARAMETERS IS FAILING

    Hi,
    I am using CONCSUB command in one of my shell program, where in it will get the parameters from report. Below mentioned is my command.
    CONCSUB $p_userid_passwd AR "Receivables Manager, RP" $p_user_name WAIT=Y \
    CONCURRENT XXRP XXFND_SEND_MAIL $v_conc_request_id "$p_to_role" "$p_from_role" "$p_subject" "$p_body" "$p_dist_list" '""' LANGUAGE=AMERICAN
    The parameters are running text like some times in p_subject i will get big description like 'emailing transaction report'
    this parameter is splitted into three and supplied into rest parameters.
    As per developer guide if we have running long running text we need to enclose first in double quotes and then again in single quotes. When I am doing in that way it is showing all errors results. Sometimes all values get merged into one thing.
    Please help me how to differentiate when they are passing like above mentioned.
    Regards,
    nagendra

    Error is that for pl/sql script five parameters but through variables when I am sending to concurrent program they are splitting into 8 parameters.
    like i am passing these parameters to pl/sql script
    452024, DC.DKHOO, DC.DKHOO, rp audit transaction report, please find, RP_EMAIL_DIST_LIST2
    then in shell program it is being shown as
    452024, DC.DKHOO, DC.DKHOO, rp, audit, transaction, report, please, find, RP_EMAIL_DIST_LIST2
    The problem with concsub is that it will consider space as ','. So it is placing comma after every space. In the developer guide itself only they mentioned we can double quotations and single qutotions.
    '"this is an example"'. This works fine when you are passing manually. But when sending programatically like this '"$P_SUBJECT"'.  Then I am getting value as $P_SUBJECT in place of valuePlease let me know how to use running text value parameters in CONCSUB.
    Regards,
    Nagendra

Maybe you are looking for

  • Could not delete from specified table?

    hi all, i'm getting this error could not delete from specified table when i execute a delete on dbf file via JDBC-ODBC bridge, when i execute an update table command i get operation must use an updatable query, but i'm not updating the query returned

  • Links inactive

    adding pages to web site......links work in iWeb, but inactive when viewing published pages........on iWeb 9.0.3........any suggestions would be greatly appreciated.......thank you

  • What happens if I reset network settings on my iphone5

    I've backed up my iphone5 and now I am thinking of trying to reset network settings to see if that fixes my built in camera that decided to stop working right before Christmas. What exactly happens if I reset network settings?

  • OIM 11g recon error

    Hi All I have a custom target recon job. When the job runs for the first time, recon events are created and processed, but when I run the following query, I don't see the events getting completed: select rb_key, rb_batch_status, rb_profile_name from

  • I'm trying to purchase a subscription for nat geo and it keeps saying i cant

    I'm trying to purchase a subscription for nat geo and it keeps saying i cant