Is there any way to keep track of all Ambari alerts? Does Ambari keeps the alerts?
In UI there is no option to view all older Alerts information however you can find that in the database alert_history table. on other side you can configure SNMP notifications as well so that you can keep track of those at SNMP server side.
The Alert History endpoint can provide you what you need:
This allows you to query for alerts through the REST API by name, service, criticality, etc.