How to get total alarm duration and occurrences by alarm

You would need to tell us what you have done and where you are stuck. Be precise. If posting code then format it properly: Wiki - how to post code on this forum