dreport: Collect IBM error objects on IBM systems

Add a plugin for systems in the meta-ibm layer
to collect the com.ibm.Logging objects in a dump.

Resolves openbmc/openbmc#3043

Tested: Run dreport and check that the IBM data is there.

Change-Id: Iaa01a07633265c767649caaf8b9b1580f31ce7cd
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/recipes-phosphor/dump/phosphor-debug-collector/plugins.d/ibm_elogall b/recipes-phosphor/dump/phosphor-debug-collector/plugins.d/ibm_elogall
new file mode 100644
index 0000000..3054f23
--- /dev/null
+++ b/recipes-phosphor/dump/phosphor-debug-collector/plugins.d/ibm_elogall
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# config: 2 20
+# @brief: Get the IBM specific elog objects
+#
+
+. $DREPORT_INCLUDE/functions
+
+desc="IBM elog"
+
+entries=$(busctl --list --no-pager tree \
+                 com.ibm.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 call --verbose --no-pager \
+                com.ibm.Logging \
+                /xyz/openbmc_project/logging \
+                org.freedesktop.DBus.ObjectManager \
+                GetManagedObjects"
+
+file_name="ibm_elogall.log"
+
+add_cmd_output "$command" "$file_name" "$desc"