Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include gdb backtrace into email notification for C/CPP programs #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/libreport/mailx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
$emailfrom = "abrt@${::fqdn}",
$emailto = "root@${::fqdn}",
$sendbinarydata = 'no',
$include_backtrace_ccpp = false,
) {
include ::abrt

Expand Down
27 changes: 25 additions & 2 deletions templates/libreport/events.d/mailx_event.conf.el7
Original file line number Diff line number Diff line change
@@ -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
27 changes: 25 additions & 2 deletions templates/libreport/events.d/mailx_event.conf.el8
Original file line number Diff line number Diff line change
@@ -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