135586cd2SJayanth Othayoth#!/bin/bash
235586cd2SJayanth Othayoth#
335586cd2SJayanth Othayoth# config: 2 20
435586cd2SJayanth Othayoth# @brief: Get all the available elogs from BMC.
535586cd2SJayanth Othayoth#
635586cd2SJayanth Othayoth
735586cd2SJayanth Othayoth. $DREPORT_INCLUDE/functions
835586cd2SJayanth Othayoth
935586cd2SJayanth Othayothdesc="elog"
1035586cd2SJayanth Othayoth
1135586cd2SJayanth Othayothentries=$(busctl --list --no-pager tree \
1235586cd2SJayanth Othayoth                 xyz.openbmc_project.Logging | grep \
1335586cd2SJayanth Othayoth                 '/xyz/openbmc_project/logging/entry/')
1435586cd2SJayanth Othayoth
1535586cd2SJayanth Othayoth#check for elog entries.
1635586cd2SJayanth Othayothif [ -z "$entries" ]; then
1735586cd2SJayanth Othayoth    log_info "No $desc entries"
1835586cd2SJayanth Othayoth    exit 0
1935586cd2SJayanth Othayothfi
2035586cd2SJayanth Othayoth
21*7533eb3fSJayanth Othayothcommand="busctl call --verbose --no-pager \
22*7533eb3fSJayanth Othayoth                xyz.openbmc_project.Logging \
23*7533eb3fSJayanth Othayoth                /xyz/openbmc_project/logging \
24*7533eb3fSJayanth Othayoth                org.freedesktop.DBus.ObjectManager \
25*7533eb3fSJayanth Othayoth                GetManagedObjects"
2635586cd2SJayanth Othayoth
2735586cd2SJayanth Othayothfile_name="elogall.log"
2835586cd2SJayanth Othayoth
2935586cd2SJayanth Othayothadd_cmd_output "$command" "$file_name" "$desc"
30