Is there any way via alerting to have Orion email a copy of the screenshot of an error with the alert?
Hello rmyerspin,
as aLTeReGo wrote, SEUM version 1.5 has support for ${ScreenshotUrl} macro. The macro contains relative URL so you will still need to specify your server address. Let me give you a brief example:
<img src="">192.168.40.156:8787/${ScreenshotUrl}" />
You can also specify width of the screenshot image by adding optional parameter:
<img src="">192.168.40.156:8787/${ScreenshotUrl}&width=500" />
Hello,here is step-by-step guide how to include screenshots in your alert emails.
<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>
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.
Hoping someone can continue this thread and provide some help.
I've been trying to get these error alert screenshots to work for the last couple of days and been struggling a bit. I believe I have the html and SQL statement correct . However, I'm still not getting the screenshots in the email alerts, I either get a box with a Red "X" or it says "There is no screenshot available". Here is the html that I'm placing in my trigger action message(s):
<html><body>TRANSACTION: ${TransactionName}STEP: ${Name}STATUS: ${Status}DATE/TIME: ${DateTime}LAST RUN: ${LastPlayed}ERROR DESCRIPTION: ${ErrorMessage}<img src="192.168.40.156:8787/.../ScreenshotImage.ashx 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=Guest&Password=xxxxxxxx" /></body></html>
Here is the resulting html email alert that I receive from the above Trigger Message.
Below is the source code from one of my email alerts and it appears to correct, right?
<img src="">192.168.40.156:8787/.../ScreenshotImage.ashx /><br/></body></html>
Also if I log into the Orion console as Guest and then paste the above URL from the source code, "">192.168.40.156:8787/.../ScreenshotImage.ashx. I am presented with the following screen....
So it seems as though its working, partially, there's just not a screenshot. I just don't understand how could that be? When I am able to go into the transaction having the error and I can clearly see the error screenshot in the console which looks like this...
Here are my specs:
Thanks,
Randall
This thread was started when SeUM 1.0 was available. Since then we've added this feature natively to the product in SeUM 1.5 through the advanced alert macro ${ScreenshotUrl}. This should eliminate the need for you to do any custom SQL alerts.