check_sentry is a Nagios plugin that is used to send test exception to the Sentry app and thus monitor its availability.
check_sentry.sh file launches check_sentry.py Python script which uses sentry_sdk to send test exception.
Because its output is quite messy and I couldn't manage to redirect it to bash variable, it was redirected to output file.
By default output file will be located in /tmp/output.txt path.
Content of the output file is checked for occurence of "ERROR:" string.
- in Sentry app create dedicated organization
- create dedicated Python project
- in project settings go to SDK Setup -> Client Keys (DSN)
- click Generate New Key button, copy DSN string and paste it as a DSN var value in check_sentry.py file
https://docs.sentry.io/error-reporting/configuration/?platform=python