dreport: Added elogall plugin

Plugin used for collecting all elogs from the BMC.

Change-Id: I64cc74aef5beba62da203714734b67af370da9d7
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/tools/dreport.d/plugins.d/elogall b/tools/dreport.d/plugins.d/elogall
new file mode 100644
index 0000000..fbbe345
--- /dev/null
+++ b/tools/dreport.d/plugins.d/elogall
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# config: 2 20
+# @brief: Get all the available elogs from BMC.
+#
+
+. $DREPORT_INCLUDE/functions
+
+desc="elog"
+
+entries=$(busctl --list --no-pager tree \
+                 xyz.openbmc_project.Logging | grep \
+                 '/xyz/openbmc_project/logging/entry/')
+
+#check for elog entries.
+if [ -z "$entries" ]; then
+    log_info "No $desc entries"
+    exit 0
+fi
+
+command="busctl --list --no-pager tree \
+                 xyz.openbmc_project.Logging | grep \
+                 '/xyz/openbmc_project/logging/entry/' \
+                 | xargs -I {} busctl --verbose --no-pager \
+                 call xyz.openbmc_project.Logging {} \
+                 org.freedesktop.DBus.Properties GetAll s \
+                 xyz.openbmc_project.Logging.Entry"
+
+file_name="elogall.log"
+
+add_cmd_output "$command" "$file_name" "$desc"