diff --git a/manifests/libreport/mailx.pp b/manifests/libreport/mailx.pp index cb12531..7185e57 100644 --- a/manifests/libreport/mailx.pp +++ b/manifests/libreport/mailx.pp @@ -20,6 +20,7 @@ $emailfrom = "abrt@${::fqdn}", $emailto = "root@${::fqdn}", $sendbinarydata = 'no', + $include_backtrace_ccpp = false, ) { include ::abrt diff --git a/templates/libreport/events.d/mailx_event.conf.el7 b/templates/libreport/events.d/mailx_event.conf.el7 index 65f3c07..f66fbd0 100644 --- a/templates/libreport/events.d/mailx_event.conf.el7 +++ b/templates/libreport/events.d/mailx_event.conf.el7 @@ -1,5 +1,28 @@ -EVENT=notify reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf +<% if @include_backtrace_ccpp -%> +EVENT=notify analyzer=CCpp + # CCpp notify event sending e-mail with full gdb backtrace + # extract build ids from coredump file and save them in 'build_ids' file + abrt-action-analyze-core --core=coredump -o build_ids >>event_log 2>&1 && + # call gdb to generate backtrace with local variables, call arguments + # disassembly, etc. and save it in 'backtrace' file + abrt-action-generate-backtrace >>event_log 2>&1 && + # generate 'duphash', 'crash_function' and 'backtrace_rating' + abrt-action-analyze-backtrace >>event_log 2>&1 + # + # send e-mail + Mailx_Subject="[abrt][$(cat component)] a crash has been detected" \ + reporter-mailx -c /etc/libreport/plugins/mailx.conf -EVENT=notify-dup reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf +EVENT=notify-dup analyzer=CCpp + Mailx_Subject="[abrt][$(cat component)] a repeated crash has been detected" \ + reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf +<% end -%> +EVENT=notify analyzer!=CCpp + Mailx_Subject="[abrt][$(cat component)] a crash has been detected" \ + reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf + +EVENT=notify-dup analyzer!=CCpp + Mailx_Subject="[abrt][$(cat component)] a repeated crash has been detected" \ + reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf EVENT=report_Mailx reporter-mailx diff --git a/templates/libreport/events.d/mailx_event.conf.el8 b/templates/libreport/events.d/mailx_event.conf.el8 index 65f3c07..f66fbd0 100644 --- a/templates/libreport/events.d/mailx_event.conf.el8 +++ b/templates/libreport/events.d/mailx_event.conf.el8 @@ -1,5 +1,28 @@ -EVENT=notify reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf +<% if @include_backtrace_ccpp -%> +EVENT=notify analyzer=CCpp + # CCpp notify event sending e-mail with full gdb backtrace + # extract build ids from coredump file and save them in 'build_ids' file + abrt-action-analyze-core --core=coredump -o build_ids >>event_log 2>&1 && + # call gdb to generate backtrace with local variables, call arguments + # disassembly, etc. and save it in 'backtrace' file + abrt-action-generate-backtrace >>event_log 2>&1 && + # generate 'duphash', 'crash_function' and 'backtrace_rating' + abrt-action-analyze-backtrace >>event_log 2>&1 + # + # send e-mail + Mailx_Subject="[abrt][$(cat component)] a crash has been detected" \ + reporter-mailx -c /etc/libreport/plugins/mailx.conf -EVENT=notify-dup reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf +EVENT=notify-dup analyzer=CCpp + Mailx_Subject="[abrt][$(cat component)] a repeated crash has been detected" \ + reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf +<% end -%> +EVENT=notify analyzer!=CCpp + Mailx_Subject="[abrt][$(cat component)] a crash has been detected" \ + reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf + +EVENT=notify-dup analyzer!=CCpp + Mailx_Subject="[abrt][$(cat component)] a repeated crash has been detected" \ + reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf EVENT=report_Mailx reporter-mailx