summaryrefslogtreecommitdiffstats
path: root/tools/dreport.d/plugins.d/journalpid
blob: 0481d4ddb52276bab8619efe6ab2aa599528bfb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#
# config: 13 1
# @brief: Collect user initialized PID specific journal log information.
#

. $DREPORT_INCLUDE/functions

desc="Journal pid:$pid log"

if [ $pid -eq $ZERO ]; then
    log_warning "Missing PID, Collecting last 500 journal entries"
    file_name="journal.log"
    command="journalctl -o verbose -n $JOURNAL_LINE_LIMIT"
else
    file_name="journal-pid-$pid.log"
    command="journalctl -o verbose _PID=$pid"
fi

add_cmd_output "$command" "$file_name" "$desc"
OpenPOWER on IntegriCloud