This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Alerting and sending SEUM Screenshot from error

Is there any way via alerting to have Orion email a copy of the screenshot of an error with the alert?

  • Hello,
    here is step-by-step guide how to include screenshots in your alert emails.

    1. Open alert definition in Advanced Alert Manager
    2. Click on "Trigger Actions" tab and there click on "Add new action"
    3. Select "Send an E-Mail / Page" action
    4. Enter required recipient and sender on "E-Mail/Pager Addresses" tab
    5. Click on "Message" tab and there select "Html format" option, enter required "Subject" and into "Message" box enter:
      <html><body>
      Transaction '${Name}' is in '${StatusDescription}' state.
      
      <img src="http://YOUR_ORION_SERVER/Orion/SEUM/Controls/ScreenshotImage.ashx
      ?entity=Orion.SEUM.TransactionSteps
      &entityId=${SQL:SELECT TOP 1 TransactionStepId 
      FROM SEUM_TransactionStepsAlertsData 
      WHERE TransactionId = ${TransactionId} 
      AND Status = 2}
      &useThumbnail=true&width=500&
      AccountID=admin&Password=" />
      </body></html>
      

      Whole URL in <img src="..." /> must be without space/newline characters. Here I wrapped it so it is readable but when you write it into alert definition, ensure that there are no spaces in it.



      YOUR_ORION_SERVER - should be URL of your SEUM server that you will be able to access from email client where you want to see screenshots.

      Status = 2
       - means that it selects screenshot of step that is down (status = 2). You can change it if you for example need screenshots for critical steps.

      AccountID=admin&Password= - This is authentication info that will be used to access image in SEUM. Example here is for user "admin" and empty password. For user "test" and password "mypassword" this part of URL will be AccountID=test&Password=mypassword
    6. On "SMTP Server" tab enter required SMTP server configuration.
    7. Save changes.

    Now you should receive email with screenshot of failing step. Screenshot is still located on SEUM server and is accessed remotelly so your email client must be able to connect to SEUM server to download image.

  • I just realized that image URL that I provided in post above gives you latest image so if you look at email when transaction is back UP, you will see current UP image. To fix this just change <img src="..." /> to:

    <img src="YOUR_ORION_SERVER/.../ScreenshotImage.ashx
    ?entity=Orion.SEUM.StepResponseTimeDetail
    &entityId=${SQL:SELECT TOP 1 TransactionStepId 
    FROM SEUM_TransactionStepsAlertsData WHERE TransactionId = ${TransactionId} AND Status = 2} &width=500&dateTime= ${SQL:SELECT CAST(DATEDIFF(n,'00010101 00:00:00',[LastPlayed]) AS bigint)*60*10000000 FROM SEUM_TransactionsAlertsData WHERE TransactionId = ${TransactionId}} &AccountID=admin&Password=" />

    One difference is that "entity" is changed to "Orion.SEUM.StepResponseTimeDetail" which contains history of failed screenshots.
    Second difference is that you need to specify "dateTime" parameter to define which screenshot you want. It's in "ticks" so that is why there is that complicated arithmetic expression.
    Also notice that I removed "useThumbnail" parameter from URL so that you can get custom size of image defined by "width" parameter.

    Let me know if you have any issues using this.

  • Thanks for the great info. 

    My concern at this point is embedding a userid and password into a  url. 

    Is there any way to do this without including a password? 

  • Unfortunately not. Screenshot image is served by SEUM and it requires authentication. I suggest creating some read-only quest account for this purpose and use it.

    Would you be interested in feature when screenshots are available on some static URL also without authentication? Isn't is a security risk if anyone can see screenshots if they know specific URL?

  • This setup doesn't work for me because our SQL server is seperate its not running on the same server as orion is. Would you know the SQL query Iwould need to use to be able to get screenshots?

     

     

    Thanks

  • SQL server on different machine should not affect this unless it has different time than Orion server. Is your SQL server in the same timezone and is time of SQL and Orion synchronized?

  • The SQL server time was 5mins off from orion but I changed to match within seconds and I am still just getting a blank box in email.

  • If you display email source, get URL from <img src="..." /> and try to navigate to this URL in browser, do you get a image? Also what this URL actually is in your case (except credentials).

  • I used URL

     
    http://10.0.10.69/Orion/SEUM/Controls/ScreenshotImage.ashx?entity=Orion.SEUM.TransactionSteps&entityId=${SQL:SELECTTOP1TransactionStepIdFROMSEUM_TransactionStepsAlertsDataWHERETransactionId=${TransactionId}ANDStatus=2}&useThumbnail=true&width=500&AccountID=admin&Password=xxxxx
    I get and orion website error unavailable    
     

    Your specific error is:

    Entity ID for screenshot is invalid: ${SQL:SELECTTOP1TransactionStepIdFROMSEUM_TransactionStepsAlertsDataWHERETransactionId=${TransactionId}ANDStatus=2}