GoldenGate monitoring and sending notifications
In GoldenGate Microservices architecture (on-premise or marketplace) is not available any out of the box feature to monitor and send notifications when a process fails.
Since GoldenGate microservices has an extensive list of rest APIs that we can use and integrate with any application, I decided to take advantage of that and build a simple python script that uses some APIs for Extracts and Replicats, specifically these:
- List Extracts: /services/{version}/extracts
- Retrieve Extract Status: /services/{version}/extracts/{extract}/info/status
- Retrieve Extract Report: /services/{version}/extracts/{extract}/info/reports/{report}
- List Replicats: /services/{version}/replicats
- Retrieve Replicat Status: /services/{version}/replicats/{replicat}/info/status
- Retrieve Replicat Report: /services/{version}/replicats/{replicat}/info/reports/{report}
The script check for all extracts and replicats if they are running, if not send an email. If it is running, it checks the lag. Depending on the value (in seconds) send an email. In the script, I defined 10 seconds of lag to send an email.
Note: The script has been tested on Oracle Linux. You can find some SSL errors when sending the email from Mac OS.
You can find the code in my GitHub:
https://github.com/eloilopes/GoldenGateExamples/tree/MonitorGoldenGate
I’m not responsible for the use of code and I don’t commit to keep the code updated for newer GoldenGate versions.
I hope this can help you. If you have any doubt, please reach out to me through LinkedIn or Medium.
References:
https://docs.oracle.com/en/middleware/goldengate/core/21.3/oggra/rest-endpoints.html
https://docs.oracle.com/en/middleware/goldengate/core/21.3/oggra/