diff options
| author | Jayanth Othayoth <ojayanth@in.ibm.com> | 2017-08-09 07:05:06 -0500 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-22 20:48:18 +0000 |
| commit | e61aee3343dfd92a5d693227bf6ff738aa3ab987 (patch) | |
| tree | 03201e6b4a2ef7d9d991ab2133f56a283e861e5e /tools | |
| parent | 0862c48e113214a0d4675e6a169f3ff0894bee2d (diff) | |
| download | phosphor-debug-collector-e61aee3343dfd92a5d693227bf6ff738aa3ab987.tar.gz phosphor-debug-collector-e61aee3343dfd92a5d693227bf6ff738aa3ab987.zip | |
dreport: Add command array support for type "core"
Change-Id: I1af8a3c26e05c916a3e6d342b0a39f7b37be296c
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/dreport | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/dreport b/tools/dreport index a6cf2b2..42b9733 100755 --- a/tools/dreport +++ b/tools/dreport @@ -88,6 +88,28 @@ command_list=( ) } +# @brief Initialize core type command array +function runlevel_core() +{ +command_list=( + move_optional_file + get_proc_journal + get_fw_level + get_uname + get_uptime + get_disk_usage + bmc_state + host_state + chassis_state + get_host_info + get_failed_services + get_obmc_console + get_cpuinfo + get_meminfo + get_top +) +} + function get_fw_level() { desc="Firmware Release" @@ -128,6 +150,14 @@ function get_journal() run_command "$command" "$copy_loc" "$desc" } +function get_proc_journal() +{ + desc="Process Journal log" + command="journalctl -o verbose _PID=$core_pid" + copy_loc="proc_journal.log" + run_command "$command" "$copy_loc" "$desc" +} + function get_host_info() { desc="Host information" @@ -237,6 +267,22 @@ function get_esel() run_command "$command" "$copy_loc" "$desc" } +function move_optional_file() +{ + desc="Move Optional file" + + mv $optional_file $name_dir + if [ $? -ne 0 ]; then + log_error "Failed to move file $optional_file" + return 1 + fi + if check_size "$name_dir/$(basename "$optional_file")"; then + log_info "Moving file $file_name" + else + log_warning "Skipping $file_name move" + fi +} + # @brief Run the requested command and save the output # into temporary location for successful size check |

