DX Application Performance Management

Expand all | Collapse all

How to pass error message to an alert

  • 1.  How to pass error message to an alert

    Posted Apr 30, 2013 07:05 AM
      |   view attached
    Hello,

    I need some assistance to solve this problem:

    In my monitored application server I get some errors and I want to pass the highlighted error message to a shell script to send email or sms about the error. Is there a way to do this?


  • 2.  RE: How to pass error message to an alert

    Broadcom Employee
    Posted May 01, 2013 07:43 PM
    You could create a shell action which calls CLW to extract the error event, process for the content you want, then send to your email script.


  • 3.  RE: How to pass error message to an alert

    Posted May 02, 2013 03:37 PM
    Hi

    Also working on this, I'm assuming by alert you mean one on a introscope console?

    @hdavis, you mentioned that you can script a call to the CLW to extract the error event. Pardon my ignorance but where can I read up on that please?


  • 4.  RE: How to pass error message to an alert

    Broadcom Employee
    Posted May 02, 2013 09:29 PM
    Do a search here on the community or on the bookshelf for "errorsnapshot" for details about viewing or extracting error events.


  • 5.  RE: How to pass error message to an alert

    Posted May 06, 2013 06:13 PM
    You can read more about this in the Using the Command-Line Workstation chapter of the CA APM Configuration and Administration Guide.


  • 6.  RE: How to pass error message to an alert
    Best Answer

    Broadcom Employee
    Posted May 06, 2013 02:15 AM
    EDIT: Sorry...I totally mistook this thread for another. The field extension I mentioned would not provide the answer you're looking for.

    The best option is to use commandline workstation extract the trace information which outputs in XML format. You'll need to parse the data or send the XML to your recipients.


  • 7.  RE: How to pass error message to an alert

    Posted May 07, 2013 03:47 AM
    Can you please give me a hint which CLW argument should I use to extract the error message?

    I tried to use "get historical data from agents matching" and "get raw historical data from agents matching" but I can't see the error message.


  • 8.  RE: How to pass error message to an alert

    Posted May 07, 2013 11:10 AM
    Take a look at the Get summaries matching <VALUE> command.


  • 9.  RE: How to pass error message to an alert

    Posted May 08, 2013 07:49 AM
    Thx. It is working. But I have some questions about it.

    The collection took 5 mins and produced a 50+ MB xml with 4 days of events.
    I used this reg exp: \"agentname\"
    If i use this: between \"2013-05-07 08:00:00\" and \"2013-05-08 13:00:00\" it wont collect anything. I gues it is not working in this command.

    From the error alert, I know the agent name and the time it is occured. What regular expression should I use to extract only the occured error message?

    This is the example result:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <TransactionTracerSession Duration="78" Version="0.1" EndDate="2005-06-20T17:40:24.146-08:00" StartDate="2005-06-20T17:40:24.068-08:00" User="Admin">
    <TransactionTrace Domain="SuperDomain" Duration="78" Process="UnknownProcess" Host="maddleman-dt2" AgentName="Tomcat" StartDate="2005-06-20T17:40:24.068-08:00" EndDate="2005-06-20T17:40:24.146-08:00">
    <CalledComponent RelativeTimestamp="0" Duration="78" ComponentType="Browser" ComponentName="Browser" MetricPath="Browser">
    <Parameters>
    <Parameter Value="" Name="URL"/>
    <Parameter Value="Normal" Name="Trace Type"/>
    <Parameter Value="\20050620\17\1119314425302" Name="Trace ID"/>
    <Parameter Value="" Name="User ID"/>
    </Parameters>
    </CalledComponent>
    </TransactionTrace>
    </TransactionTracerSession>

    What is the text the REGULAR EXPRESSION applies to?


  • 10.  RE: How to pass error message to an alert

    Broadcom Employee
    Posted May 08, 2013 05:43 PM
    Sometimes the date format will change with different queries. I've had to change my CLW on occasions.

    Try changing it to mm-dd-yyyy and run your query manually.


  • 11.  RE: How to pass error message to an alert

    Posted May 09, 2013 03:30 AM
    No luck...

    /usr/java/jre1.6.0_21/bin/java -Duser=*** -Dpassword=*** -Dhost=***.***.xx -Dport=36001 -jar lib/CLWorkstation.jar get historical event summaries matching 05-09-2013
    No transaction traces collected.

    I tried with "05-09-2013" and \"05-09-2013\" both didnt work.

    Can anyone extract exactly one transaction trace information from the SmartStor?


  • 12.  RE: How to pass error message to an alert

    Posted May 09, 2013 12:01 PM
    Unfortunately, it looks like the full command syntax for retrieving trace and event data is only the below two formats:

    [font=Courier New]get historical events matching [REGULAR EXPRESSION]
    get historical event summaries matching [REGULAR EXPRESSION][font]

    [font=Courier New][REGULAR EXPRESSION][font] is for matching the agent, and so can match the Host name, Process name, and/or Agent name. Neither format seems to support the [font=Courier New]between [EXACT MATCH] and [EXACT MATCH][font] qualifier to search by time range. This would be a good enhancement request, via the Ideas tab, above.


  • 13.  RE: How to pass error message to an alert

    Posted May 09, 2013 12:18 PM
    If you are feeling really ambitious, you could take advantage of the fact that the traces database is an Apache Lucene database, version 2.9, and query it directly using another command line utility, such as lucene-sql, or lucli (the official one, here's a man page for it).

    If you were to go this route, be very careful and practice against a copy of your traces database (using read-only mode, etc.), as this could run the risk of corrupting the indexes (easy to fix, but still).


  • 14.  RE: How to pass error message to an alert

    Posted May 09, 2013 02:16 PM
    Oh, and there's always the JDBC API, which allows you to execute SQL queries to retrieve events and traces (in full or the overviews) by time, while still supporting the Lucene DB query syntax for finding the correct agent and component:

    [font=Courier New]select * from trace_headers where timestamp between '05/09/13 00:00:00' and '05/09/13 23:59:59' and query='host:maddleman-dt2 AND agent:Tomcat'
    select * from traces where timestamp between '05/09/13 00:00:00' and '05/09/13 23:59:59' and query='host:maddleman-dt2 AND agent:Tomcat' limit 1[font]

    You could create a simple Java application that accepts command line arguments, builds and executes the query, and outputs the results to stdout.


  • 15.  RE: How to pass error message to an alert

    Posted May 10, 2013 02:40 AM
    Thank you! I will try the lucene-sql or the lucli.


  • 16.  RE: How to pass error message to an alert

    Posted May 10, 2013 11:59 AM
    Great! Please share the results of your efforts, once you can.