I use custom alertscript, because Zabbix doesn't support email alerts with authentication (+TLS, ...). My custom alertscript handle all problems and it will exit with exit code 0 only if email was sent successfully. Otherwise it's non zero exit code. Recently I've had a problem with my SMTP servers - my account was "blocked" and alertscript was returning non-zero exit code and stderr "blocked user". However zabbix counts these notification as success and they are available in notifications statistic.
Is it possible to check exit code of custom alertscript execution and count only executions with exit code 0?
Also any (internal) event/action/notification/metric (emergency media type) about failed notifications will be fine => I would like to know from Zabbix, that I have problem with custom alertscript.