-
Notifications
You must be signed in to change notification settings - Fork 40
Reporter systemd journal
reporter-systemd-journal is shipped by libreport-plugin-systemd-journal.
The tool reads problem directory DIR and sends message with its details into systemd journal.
Takes following arguments:
-m, -message-id MESSAGEID - Catalog message id.
-F FILE - Formatting file for catalog message. If the parameter is not set, reason element from problem dir is used as main log message.
-d DIR - Problem dir.
--dump NONE|ESSENTIAL|FULL - fill journal fields with text problem dir elements. If NONE, no fields will be filled (default). If ESSENTIAL, only the most important fields will be filled. If FULL, all text elements from problem dir will be filled.
- we have to specified parameter --dump, which elements will be used in each of the possibility.
There are two parts for defining format of reporters messages. The first is related to the main log message and also it is possible to add some additional information into catalog message body. This part uses ABRT's problem report API (parameter -F FILE). The second part is related to catalog messages itself and uses systemd journal catalog messages formatting (https://www.freedesktop.org/wiki/Software/systemd/catalog/).
Lines starting with # are ignored.
Lines can be continued on the next line using trailing backslash.
Format:
%summary:: format of log message
section:: element1[,element2]...
The literal text line to be assigned to catalog PROBLEM_REPORT variable.
Can be empty. (IOW: empty lines are NOT ignored!)
Summary format is a line of text, where %element% is replaced by
text element's content, and [[...%element%...]] block is used only if
%element% exists. [[...]] blocks can nest.
Sections can be:
- %summary: log message format string.
- text, double colon (::) and the list of comma-separated elements.
Text can be empty (":: elem1, elem2, elem3" works),
in this case "Text:" header line will be omitted.
Elements can be:
- problem directory element names, which get formatted as
<element_name>: <contents>
or
<element_name>:
:<contents>
:<contents>
:<contents>
- problem directory element names prefixed by "%bare_",
which is formatted as-is, without "<element_name>:" and colons
- %oneline, %multiline, %text wildcards, which select all corresponding
elements for output or attachment
- problem directory element names prefixed by "-",
which excludes given element from all wildcards
Nonexistent elements are silently ignored.
If none of elements exists, the section will not be created.
Example (name the formatting file as abrt_test_format.conf):
%summary:: Process %pid% (%executable%) crashed in %crash_function%()
::%bare_reason
::%bare_%short_backtrace
The summary part is used for main journal message. The other parts of the configuration file are assigned into PROBLEM_REPORT variable. If you can have the other parts in catalog messages, the PROBLEM_REPORT variable has to take place in template of systemd catalog message.
Example:
-- 5ab0271ecf1941a2b89299716e880661
Subject: ABRT has detected crash of @PROBLEM_EXE@
Defined-By: ABRT
Support: https://bugzilla.redhat.com/
Documentation: man:abrt(1)
@PROBLEM_REPORT@
Use abrt command line tool for further analysis or reporting
the problem to appropriate support site.
Example of use
$ reporter-systemd-journal --message-id 5ab0271ecf1941a2b89299716e880661 -F abrt_test_format.conf -d DUMP_DIRECTORY
Journal output for example above looks like folloving:
Process 15158 (will_segfault) crashed in crash()
-- Subject: ABRT has detected crash of
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- will_segfault killed by SIGSEGV
--
-- #1 crash in /usr/bin/will_segfault
-- #2 varargs in /usr/bin/will_segfault
-- #3 f in /usr/bin/will_segfault
-- #4 callback in /usr/bin/will_segfault
-- #5 call_me_back in /usr/lib64/libwillcrash.so.0.0.0
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Process 15158 (will_segfault) crashed in crash()
-- Subject: ABRT has detected crash of
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- will_segfault killed by SIGSEGV
--
-- #1 crash in /usr/bin/will_segfault
-- #2 varargs in /usr/bin/will_segfault
-- #3 f in /usr/bin/will_segfault
-- #4 callback in /usr/bin/will_segfault
-- #5 call_me_back in /usr/lib64/libwillcrash.so.0.0.0
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Process 15214 (will_python_raise) of user 0 encountered an uncaught ZeroDivisionError exception
-- Subject: ABRT has detected an uncaught exception of ZeroDivisionError in will_python_raise
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- will_python_raise:3:<module>:ZeroDivisionError: integer division or modulo by zero
--
-- #1 <module> in /bin/will_python_raise:3
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Process 18466 (will_python3_raise) of user 0 encountered an uncaught ZeroDivisionError exception
-- Subject: ABRT has detected an uncaught exception of ZeroDivisionError in will_python3_raise
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- will_python3_raise:3:<module>:ZeroDivisionError: division by zero
--
-- #1 <module> in /bin/will_python3_raise:3
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Display server Xorg crash in OsLookupColor()
-- Subject: ABRT has detected crash of display server
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- Received signal 11 sent by process 4025, uid 0
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
System encountered a fatal error in source_load()
-- Subject: ABRT has detected a fatal system error
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- kernel paging request at source_load
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
System encountered a non-fatal error in __warn()
-- Subject: ABRT has detected a non-fatal system error
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- WARNING: CPU: 0 PID: 18428 at /tmp/will_oops.r3f0fwWXQ1/will_oops.c:11 will_oops_init+0x28/0x1000 [will_oops]
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Process 18617 (willuncaught.jar) of user 0 encountered an uncaught $EXCEPTION_TYPE exception
-- Subject: ABRT has detected an uncaught exception of $EXCEPTION_TYPE in willuncaught.jar
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- PROBLEM_REPORT
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Process 18902 (will_ruby_raise) of user 0 encountered an uncaught $EXCEPTION_TYPE exception
-- Subject: ABRT has detected an uncaught exception of $EXCEPTION_TYPE in will_ruby_raise
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- PROBLEM_REPORT
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Process 15158 (crashed_binary) has encountered a problem
-- Subject: ABRT has detected a avc/selinux problem in crashed_binary
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
--
-- crashed_binary killed by SIGSEGV
--
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
NOTE - avc/selinux are [TYPE/ANALYZER] elements from dump dir. We decided to use both because of debugging. In the case the default catalog message is used, some new TYPE has been noticed.
TODO
- if PROBLEM_REPORT variable is too big, the content of the variable is not shown in catalog messages. PROBLEM_REPORT variable can be read from journal fields (journalctl -o json-pretty). Problem report should be shown.
- The piece of information which informs about using abrt command line tool should be more specific. For example "Use abrt list|report|... --uuid a6a18be226628699e98104f0ba11020e0a58020f for further analysis or repo...". The --uuid parameter has to be added into abrt tool.