cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Alerts History

fsiviero
1-Newbie

Alerts History

Hello

I've a template that has over 1000 devices. I want to get a count of all the alerts that were fired for these devices in the last 6 hours using the API. I've used Services/GetAlertHistory with the startDate and endDate just fine, problem is I've to do one call per device and all that is taking more than 4 minutes to conclude with these many devices. Is there no way to get the history for the entire template in one call? I want to reduce the time this takes to load.

Thank you for your help in advance

2 REPLIES 2
AdamR
12-Amethyst
(To:fsiviero)

Francisco,

There is a system Stream named AlertHistoryStream where all of this data is stored.  It is a System Object so not visible by default in Composer (nor is it ever editable).  You can see it by going to the advanced filter options and checking the Show System Objects checkbox.  It does include default services for streams that will allow you to query directly.  Be sure to use the built in Date filters when querying or you will eventually see performance issues.

Thanks,

Adam

fsiviero
1-Newbie
(To:AdamR)

Hello Adam,

Thank you for your response. This seems to work great, I get a significant improvement in terms of performance. I have just one question though: There seems to be no way to limit the alerts that you get to a specific template and from what I can see in the data that I'm receiving there is no information on which template each entry belongs to. Am I missing something or should I've a list of devices per template and match it to each entry that I get from the stream?

Thank you again.

Top Tags