xref: /openbmc/phosphor-debug-collector/tools/dreport.d/plugins.d/journalpid (revision 6d7f753ba7ecc2dd062758a46ef77ce5c44b9bdb)
1a172469dSJayanth Othayoth#!/bin/bash
2a172469dSJayanth Othayoth#
3*6d7f753bSMarri Devender Rao# config: 134 1
4a172469dSJayanth Othayoth# @brief: Collect user initialized PID specific journal log information.
5a172469dSJayanth Othayoth#
6a172469dSJayanth Othayoth
7a172469dSJayanth Othayoth. $DREPORT_INCLUDE/functions
8a172469dSJayanth Othayoth
9a172469dSJayanth Othayothdesc="Journal pid:$pid log"
10aa146d62SJayanth Othayoth
11aa146d62SJayanth Othayothif [ $pid -eq $ZERO ]; then
12aa146d62SJayanth Othayoth    log_warning "Missing PID, Collecting last 500 journal entries"
13aa146d62SJayanth Othayoth    file_name="journal.log"
14aa146d62SJayanth Othayoth    command="journalctl -o verbose -n $JOURNAL_LINE_LIMIT"
15aa146d62SJayanth Othayothelse
16a172469dSJayanth Othayoth    file_name="journal-pid-$pid.log"
17a172469dSJayanth Othayoth    command="journalctl -o verbose _PID=$pid"
18aa146d62SJayanth Othayothfi
19a172469dSJayanth Othayoth
20a172469dSJayanth Othayothadd_cmd_output "$command" "$file_name" "$desc"
21