Define Corrective Actions based on URL

Hello,
I'm new to using 10gR3 Grid control -
Is there a way of defining a corrective action based on the success of a URL - so if a URL fails with say a 404 error or times out, an OS script can be run.
I can only find ways of assigning corrective actions with pre-defined alert metrics.
Thanks for any help

At the risk of repeat-posting, I'll clarify. Say I create a file named routing.xml which defines some routes like this:
<routing-config>
  <route>
    <name>Standard rule</name>
    <description>
      This route maps the first two parts in the path with the module and action
    </description>
    <url-pattern>/:module/:action.do</url-pattern>
  </route>
  <route>
    <name>Default Index</name>
    <description>
      Allows the module to be specified without the action for "Index" actions.
    </description>
    <url-pattern>/:module.do</url-pattern>
    <request-parameters>
      <parameter key="action" value="Index" />
    </request-parameters>
  </route>
  <route>
    <name>Homepage</name>
    <description>
      Loads the Home page
    </description>
    <url-pattern>/</url-pattern>
    <request-parameters>
      <parameter key="module" value="Home" />
      <parameter key="action" value="Index" />
    </request-parameters>
  </route>
</routing-config>The bits like ":module" which be represented by the actual name of the module in the URL. Does anyone know if something like this already exists? :)
I wrote this exact same thing in PHP5 just a few weeks ago but I really don't have the motivation to write it all over again in Java :P On a side-note, things like this usually come with helpers for turning unclean URIs into clean URIs.

Similar Messages

  • What's the best way to define some values based on the URL?

    Let's say for example I want all my URLs for servlets to take the form:
    http://mysite.com/module/action?arguments
    What's the most scalable way to handle mapping the values in place of "module" and "action"? For example, I might have a "forum" module and have an action to "deleteThread", called like so:
    http://mysite.com/forum/deleteThread?id=321
    I know I can just parse it myself, but is there a better way to handle this via some settings in web.xml or similar? All my requests go through a Front Controller which needs to know which module and action have been requested so that it can run the appropriate action controller.
    Cheers,
    Chris

    At the risk of repeat-posting, I'll clarify. Say I create a file named routing.xml which defines some routes like this:
    <routing-config>
      <route>
        <name>Standard rule</name>
        <description>
          This route maps the first two parts in the path with the module and action
        </description>
        <url-pattern>/:module/:action.do</url-pattern>
      </route>
      <route>
        <name>Default Index</name>
        <description>
          Allows the module to be specified without the action for "Index" actions.
        </description>
        <url-pattern>/:module.do</url-pattern>
        <request-parameters>
          <parameter key="action" value="Index" />
        </request-parameters>
      </route>
      <route>
        <name>Homepage</name>
        <description>
          Loads the Home page
        </description>
        <url-pattern>/</url-pattern>
        <request-parameters>
          <parameter key="module" value="Home" />
          <parameter key="action" value="Index" />
        </request-parameters>
      </route>
    </routing-config>The bits like ":module" which be represented by the actual name of the module in the URL. Does anyone know if something like this already exists? :)
    I wrote this exact same thing in PHP5 just a few weeks ago but I really don't have the motivation to write it all over again in Java :P On a side-note, things like this usually come with helpers for turning unclean URIs into clean URIs.

  • Time Based Corrective Action-11g Grid Control

    I need a corrective action that is based on time. There are some databases that we take cold backup (we cannot convert to hot backup for reasons beyond our control). So the backup script
    shuts down the database
    mounts the database
    backup the database
    opens the database.
    For some reason, if the backup fails the database is left in mount state. I was trying to get a corrective action that will kick off at the MOUNTED state and open the database, only if the time is after 8 AM in the morning. I do not want the corrective action kicking off when RMAN is running at night for backup.
    I was trying out the PL/SQL code
    DECLARE
    local_date DATE;
    BEGIN
    SELECT SYSDATE INTO local_date FROM dual;
    IF local_date > trunc(sysdate)+9/24 THEN
    EXECUTE IMMEDIATE 'alter database open';
    END IF;
    END;
    This script runs once reports as successful. It may or may not open the database depending on the time. Depending on the time it will leave the database in OPEN or MOUNTED state. It does not run again.
    I needed it to run as follows:
    The backup fails at 6 AM in the morning,
    The script should keep checking the time and open the database only when it is 9 AM.
    Is there a way to do that, or am I going about in in a wrong way.
    Thanks in advance for your help,
    Radhak

    Got it to work by correcting the code

  • How to define an action which generates a pdf based on a smartform formular

    Hello everybody,
    I am looking for a solution to define an action which generates a pdf based on a smartform formular (my printer
    is LOCL and there will be no other printers in the system defined).
    With the standard print action for the smartforms formular nothing is printed on printer local.
    Best regards,
    Angelika

    Hmm, no replies yet...
    Am I in 'uncharted territory' with this issue?

  • OS UDM's and Corrective action Script at a central Location

    Is that we can place the OS UDM's and Corrective action Script are to be placed at Target server side or can we place these scripts at a central location say on OMS/ OMR server and trigger from here. As if we change a particular script we need to propagate particular script to all location. Instead if we keep these at a central place we can replace that particular script at a single location.
    Please advise.
    Thanks.

    When creating an UDM, you need to create this for a specific Target like a database instance or host
    This means, when you want to create a SQL based UDM, you first need to select a database in OEM and next select the User Defined Metrics link that will allow you to create the UDM.
    After finishing the creation of a UDM, the UDM will be "owned" by the database you selected in OEM.
    This means, when having 50 databases, you are able to create several UDM's spread over all of these databases. This is a situations you don't want to get into. You most probably will want to reuse UDM on several or even all databases.
    To avoid UDM getting duplicated, being spread all over the pace you actually need a "library" where you would be able to locate the UDM's.
    Unfortunately there is not such a library in OEM. However if you decide to choose one of your databases for playing the role of a "library" at least you found a way to centrally locate all your UDM's.
    If you then want to apply one or more UDM's to several database you could create a monitoring template, include the UDM's you want to reuse on other databases and apply this template.

  • How define the action of a h:form?

    Hi, I have a page that is accessed with http that contains a form which needs to be posted to a https action. As there is no way to define the action attribute for a h:form tag, how can I implement this using the h:form tag? Is there a way to make the commandButton tag action attribute point to a url?

    With JSP+Servlets in Tomcat I would do something like this
       <form action="https://${pageContext.request.serverName}:8443${pageContext.servletContext.contextPath}/Login?action=login" method="post">
             <label for="username"><fmt:message key="user_username"/>:</label><input type="text" name="username" id="username" value="${username}"/>
             <br/>
             <label for="password"><fmt:message key="user_password"/>:</label><input type="password" name="password" id="password" value=""/>
             <br/>
             <input type="submit" value="<fmt:message key="login"/>"/>     
       </form>how I do something similar using JSF html tags?

  • How to forward action based on user logged in ?

    Hi All,
    Jdev Ver : 11.1.1.4.0
    I am using Adf security, with form based authentication..
    I have written login action in managed bean , and forwarding page using the based on url.
        public String doLogin() {
            String un = _username;
            byte[] pw = _password.getBytes();
            FacesContext ctx = FacesContext.getCurrentInstance();
            HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
          String loginUrl = null;
            try {
                Subject subject = Authentication.login(new URLCallbackHandler(un, pw));
                weblogic.servlet.security.ServletAuthentication.runAs(subject, request);
                SecurityContext sec = ADFContext.getCurrent().getSecurityContext();
                System.out.println("Profile :: "+sec.getUserProfile());
                System.out.println(sec.getUserName());
                System.out.println(sec.getUserPrincipal());
                for(String role : sec.getUserRoles()){
                  System.out.println("Roles :: "+role);
                System.out.println(JSFUtils.resolveExpression("#{securityContext.userName}"));
                if(un.equals("john.doe")){
                  //loginUrl="main";
                  loginUrl = "/adfAuthentication?success_url=/faces/main";
                }else{
                  //loginUrl="test";
                  loginUrl = "/adfAuthentication?success_url=/faces/test";
               // loginUrl = "test";//"/adfAuthentication?success_url=/faces/main";
                HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
                sendForward(request, response, loginUrl);
            } catch (FailedLoginException fle) {
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Incorrect Username or Password", "An incorrect Username or Password was specified");
                ctx.addMessage(null, msg);
            } catch (LoginException le) {
                reportUnexpectedLoginError("LoginException", le);
            return null;
        }Now i want to return some action, not using the URL. and sendforward
    any suggestions please ?
    thanks
    Gopinath

    The application is created without configuring the security, later at the end we are doing the security configuration.
    I used formbased authentication , there are 3 roles for the users, based on the users after login action i need to show the screen.(no common screen, each screen is different for each users,)
    I used executeWithParams for executing some VO's before the page loads, if i use the two or more outcome actions in login action, its not rendering the corresponding page and it remains in the same page.
    in between i have to check for user in roles , so based on that i have to set the outcome. find my above login action code.
    This is my use case, tell me suggestions and any idea please.
    thanks
    Gopinath

  • Retrieve alert values for use as parameter in corrective action sql script

    I am trying to write a corrective action sql script to kill a session that is blocking other sessions. I have the "blocking session count" metric set and the alert is firing correctly.
    Is there any way to retrieve the sid and serial number from the alert generated and use it in a corrective action sql script?
    Here is the alert generated:
    Target Name=myproddb.world
    Target Type=Database Instance
    Host=myprodserver
    Metric=Blocking Session Count
    Blocking Session ID=SID: 522 Serial#: 5228
    Timestamp=Mar 4, 2008 5:57:12 PM EST
    Severity=Warning
    Message=Session 522 is blocking 1 other sessions
    Notification Rule Name=Testing Corrective actions
    Notification Rule Owner=sysman
    Clearly the sid, and serial # is contained within the alert Message field
    what I want to write for the sql script is :
    alter system kill session '%sid%,%serial_no%' immediate;
    and have GC pass in the sid and serial_no to the script.
    The "Target Properties" listed on the right of the Edit Corrective Action screen lists minimal details pertaining to the alert and certainly not the session sid, serial no.
    Generically, is there any way to retrieve the values from an alert and use them in a corrective action script or job?
    I've looked into getting the values from the mgmt$alert_history table, but I'm hoping that GC can pass the values to the sql script.
    thanks in advance for your help.

    Hi
    You can implementing a procedure like this.
    1. When a block session count alarms occurs, there is a column in the v$lock that you can examine.
    #!/bin/ksh
    #kill_block_session.sh
    #first export your variables
    export ORACLE_HOME=/oracle/product/10.2.0.3
    export ORACLE_SID=SIDNAME
    $ORACLE_HOME/bin/sqlplus "/ as sysdba" << EOF
    execute immediate killed_blocks;
    EOF
    # end
    The killed_blocks is a procedure:
    create procedure
    declare
    v_sid varchar2(15);
    v_serial varchar2(15);
    -- now a sql query that retrieve the sid and serial
    -- you can obtain these values from v$session and v$lock
    select vs.sid,vs.serial into v_sid,v_serial
    from v$session vs,v$lock vl
    where vs.sid=vl.sid
    and vl.block >0
    -- After this, you execute a dbms_put line with these
    -- values
    But you understant that this response action is very dangerous, because its possible that you kill sessions that the blocking are transitient.
    You must examine your enviroment and your application and establish the metric like UDM and not for only session blocking count.
    You must to see:
    - The type of block
    - The ctime time in the v$lock for to understatn the amount of time to determine that the block is need killed.
    - In my opinion you need a special UDM and deactivate the blocking sesion count
    If you want help to create this UDM send me a mail to [email protected]
    Regards
    Robert

  • The Web application at could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application

    Hi,
    I have created on windows service to fetch sharepoint list ad update the list items.
    when i run this service in sharepoint server(where the sharepoint site is hosted),it is working fine. If i run the same service in another machine(sharepoint installed in this machine also). it is giving the below error
    The Web application at [URL] could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
    Code snippet
    SPSite sharepointSite = null;
                SPWeb rootWeb = null;
                try
                    //SPList current = null, previous = null;
                    string colmId = ConfigurationManager.AppSettings[ID_COLM];
                    List<TaskEntity> list = new List<TaskEntity>();
                    sharepointSite = new SPSite(URL);
                    rootWeb = sharepointSite.OpenWeb();
                    SPList current = rootWeb.Lists[ConfigurationManager.AppSettings[OMEGA_REGISTRATION_LIST]];
                    WriteEventLog("current" + current.Items.Count.ToString());
                catch (Exception ex)
                    ExceptionMethod(ex);
                finally
                    sharepointSite = null;
                    rootWeb = null;
    I have pointed .net framework to 3.5 version and target palform as Any CPU. Please suggest me

    Hi mallela1,
    I also had similar issue couple of months back when I was trying to access a remote URL from a Windows service when the site does not exists in the server where service resides.
    You cannot access a remote url (even though it is SharePoint server and also in same network ) from server object model.
    SPSite can look in the current server only. here what is happening is SPSite will look for this in the current server DB and it is not finding this errror.
    So please dont use ServerObject model for accessing remote sites. You can use Client Object model for the code /requirement you have stated above.
    I wasted lot of time in finding a work around to make to work. It did not. So look for other options.
    Regards,
    Nandini

  • JAVA_HOME is not defined correctly

    Hi everyone.
    I'm trying to run a java program I made for school but I keep getting the message in the debugger console:
    [ Session started at 2010-09-07 01:52:54 -0400. ]
    Error: JAVA_HOME is not defined correctly.
    We cannot execute /System/Library/Frameworks/JavaVM.framework/Home/bin/java
    The Debugger has exited with status 1.The Debugger has exited with status 1.
    I'm working with Xcode 3.2.3 and the java template is Java Tool. Can anyone help me fixing this?
    Thank you very much

    Grrrr. Been having a similar problem, but with Maven2. Allow me to (hopefully) save someone the gnawing of teeth and several bald patches.
    For starters, the Maven documentation gives you a pretty clear example of how to set your PATH. This is as follows:
    export PATH=/usr/whatever/whateveragain/apache-maven-2.0.10/bin:$PATH
    Simple, eh? Note the colon before $PATH. Then, it states quite presumptuously "4) Make sure JAVA_HOME is set to the location of your JDK". However, you don't set it in exactly the same way. You set it in virtually the same way, except without the colon, like this:
    export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0$JAVA_HOME
    Note that if you get the paths wrong a couple of times, you may reset them with the unset command. So to unset JAVA_HOME you'd use:
    unset JAVA_HOME
    After which you may set it again. As is advised, you may try to set the user privileges, but they didn't seem to affect my luck at all. Hope this helps!

  • Error: JAVA_HOME is not defined correctly - While running ant.

    I have upgraded the JDK 1.5 Update 10 to Update 14. After upgrading the ant is failing when using with cygwin.
    It's giving the below error message:
    Error: JAVA_HOME is not defined correctly.
    We cannot execute /cygdrive/c/Java/jdk14/bin/java
    The JAVA_HOME is set properly & even I am able to check java -version.
    I am using apache-ant-1.6.5 and cygwin.
    Have any one faced the same problem?
    Please let me know if you have any solutions

    Grrrr. Been having a similar problem, but with Maven2. Allow me to (hopefully) save someone the gnawing of teeth and several bald patches.
    For starters, the Maven documentation gives you a pretty clear example of how to set your PATH. This is as follows:
    export PATH=/usr/whatever/whateveragain/apache-maven-2.0.10/bin:$PATH
    Simple, eh? Note the colon before $PATH. Then, it states quite presumptuously "4) Make sure JAVA_HOME is set to the location of your JDK". However, you don't set it in exactly the same way. You set it in virtually the same way, except without the colon, like this:
    export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0$JAVA_HOME
    Note that if you get the paths wrong a couple of times, you may reset them with the unset command. So to unset JAVA_HOME you'd use:
    unset JAVA_HOME
    After which you may set it again. As is advised, you may try to set the user privileges, but they didn't seem to affect my luck at all. Hope this helps!

  • Different actions based on different drop down selection

    Hi,
    I am new to WebDynpro so still getting to used to the differences with what I am used to. My question is this:
    Is it possible to create a drop down list (by key) in a top view that allows the user to display one of three views in the bottom view? I know it is possible if I add a button, but I want it to look like one form so that the user is unaware of the difference. The "logical" way to me would be to have an action created for each option in the drop down list, but this does not seem possible. Any suggestions on how I could do this?
    Thanks,
    Helen

    As already explained by other posters, this is possible:
    Define an action with a parameter "selectedKey" of type string.
    Bind the DropDownByKey.onSelect event to this action.
    Map the event parameter "key" to the action parameter "selectedKey" by writing this line of code inside method wdDoModifyView():
    if (firstTime)
      IWDDropDownByKey dd = (IWDDropDownByKey) view.getElement("<ID of your drop-down>");
      dd.mappingOfOnSelect().addSourceMapping
        "key", /* event parameter name, see JavaDoc */
        "selectedKey" /* action parameter name */
    The effect of this mapping is that at runtime, the action handler parameter "selectedKey" contains the key that has been selected from the drop-down list.
    In the action handler, you can navigate to the view that corresponds to the selected key by calling the outbound-plug to this view. These firePlug* methods will be generated by the framework, if you have defined the corresponding navigation links in the view modeller.
    But: I would not use at all a drop-down list to switch views because this will not match most user's expectation. Links are more appropriate to indicate navigation to other views.
    Armin

  • Calculated keyfigures not defined correctly error when executing query

    Hi Experts,
    I changed calculations in the calculated keyfigures and saved successfully.
    when I execute the query in BI7 Bex, I am getting errors like query element not defined correctly in the query. when I look into query in the designer its giving info messages for many calculated keyfigures saying reusable and saving can influence other queries.
    I reverted back the changes but the errors still coming up. I tried to copy the query and run it ..still didnt helped..
    Please suggest me with the solution..
    Quick replies are much appreciated and awarded.
    Thanks
    Vanaja

    Hi,
    The calculated keyfigure is the difference of two other calculated keyfigures...
    I tried to re-drag and drop into keyfigures column and didn't worked and still getting the errors.
    Please suggest some more..
    Thanks
    Vanaja

  • Different links in the detailed navigation, based on URL alias

    <u>What I'm trying to do :</u>
    Based on URL aliases /irj/portal/individual or /irj/portal/business
    I will dynamically add an UME group to the already logged in user.
    <u>Filter :</u>
    If clicking on /irj/portal/individual I will store "group=individual" in the context, and add UME group individual, if clicking /irj/portal/business I will store "group=business" in the context, and add UME group business and remove individual, and then redirect to the same URL.
    <u>Configuration</u>
    Each UME group has a one-to-one mapping to a Portal role.
    I will place an ACL on the PCD content, based on group, hiding/showing aggregated folders, hanging under the roles.
    <u>Wanted end-result</u>
    Different links in the detailed navigation, based on URL alias.
    <b>My question is how you would implement the filter part, mentioned above ?</b>
    Portal app or J2EE servlet filter or something else ?

    Hi sunil,
       Create a JSPDynPage component(C) having 2 hbj:link whose hrefs point to these 2 iViews(A and B). U can get the href of the iView by previewing it(for A and B). Create an iview from the par component (C) and add it to the DLN so that it shows the links to ur iViews(A and B). U can make the Show Tray property of this iView (C) to false.
    Regards,
    Harini S

  • Business need to define credit limit based on material

    HI,
    Business need to define credit limit based on material,do we have option in SAP like this

    Hi,
    If you can consider the credit check deactivation at item category level, it is possible.  You can find a switch to deactivate credit check at VOV7.  If you can group such materials under Z item category, you can control those.
    But credit limit is not possible in standard.
    Regards,
    P Gomatheeswaran
    Edited by: Gomatheeswaran Palaniappan on Sep 22, 2011 12:21 PM

Maybe you are looking for

  • Is JavaScript the only option for AcroForm interactive field programming?

    Would it be possible to re-write document-level and field-level scripts in a compiled (C/C++) language?? -RFH

  • Compiling in DOS?

    ...ok...i am using a book to learn the basix of Java and i have come across to compiling my first program the program is saved in the dir. C:\javawork with the file name HelloSailor.java but in dos, the 8 character limitation of hte filename and 3 ch

  • EDWH Architecture

    Hi, I have a question, i read the doc, EDWH Architecture for Global Data loading strategy. in this doc. they used the term "corporate memary", please some one explain in detail, how do configure/develope this area. Thanks

  • Unable to open the expressway-Edge page

    Hi Folks, I want to know while deploying cisco expressway is it essential to have expressway-C and expressway-E must be on same version. I have expressway-C on x8.2.1 while expressway-E on x8.1.1. Would it work or it needs to be on same version.

  • Dashboard graphics

    I have just started to learn about the Xcelsius 2008 software and I have a couple of questions: 1.     Is it possible to find out what the total capacity (file size can go into a dashboard)?  I have these map files that I want to digitize.  They are