1*35586cd2SJayanth Othayoth#!/bin/bash
2*35586cd2SJayanth Othayoth#
3*35586cd2SJayanth Othayoth# config: 2 20
4*35586cd2SJayanth Othayoth# @brief: Get all the available elogs from BMC.
5*35586cd2SJayanth Othayoth#
6*35586cd2SJayanth Othayoth
7*35586cd2SJayanth Othayoth. $DREPORT_INCLUDE/functions
8*35586cd2SJayanth Othayoth
9*35586cd2SJayanth Othayothdesc="elog"
10*35586cd2SJayanth Othayoth
11*35586cd2SJayanth Othayothentries=$(busctl --list --no-pager tree \
12*35586cd2SJayanth Othayoth                 xyz.openbmc_project.Logging | grep \
13*35586cd2SJayanth Othayoth                 '/xyz/openbmc_project/logging/entry/')
14*35586cd2SJayanth Othayoth
15*35586cd2SJayanth Othayoth#check for elog entries.
16*35586cd2SJayanth Othayothif [ -z "$entries" ]; then
17*35586cd2SJayanth Othayoth    log_info "No $desc entries"
18*35586cd2SJayanth Othayoth    exit 0
19*35586cd2SJayanth Othayothfi
20*35586cd2SJayanth Othayoth
21*35586cd2SJayanth Othayothcommand="busctl --list --no-pager tree \
22*35586cd2SJayanth Othayoth                 xyz.openbmc_project.Logging | grep \
23*35586cd2SJayanth Othayoth                 '/xyz/openbmc_project/logging/entry/' \
24*35586cd2SJayanth Othayoth                 | xargs -I {} busctl --verbose --no-pager \
25*35586cd2SJayanth Othayoth                 call xyz.openbmc_project.Logging {} \
26*35586cd2SJayanth Othayoth                 org.freedesktop.DBus.Properties GetAll s \
27*35586cd2SJayanth Othayoth                 xyz.openbmc_project.Logging.Entry"
28*35586cd2SJayanth Othayoth
29*35586cd2SJayanth Othayothfile_name="elogall.log"
30*35586cd2SJayanth Othayoth
31*35586cd2SJayanth Othayothadd_cmd_output "$command" "$file_name" "$desc"
32