dreport: Add multi-host support for dumping console logs
Dump all files which match the given pattern used by obmc-console.
Tested: Built into a yosemite4 (Multi-host server) and ensured
that the resulting tarball contained `obmc-console-host1.log` to
`obmc-console-host8.log` along with the other console dumps.
Change-Id: I3197c052f10c458a72595987eac3acdb713cb27f
Signed-off-by: Amithash Prasad <amithash@meta.com>
diff --git a/tools/dreport.d/plugins.d/obmcconsole b/tools/dreport.d/plugins.d/obmcconsole
index bdb46d4..ed76d02 100644
--- a/tools/dreport.d/plugins.d/obmcconsole
+++ b/tools/dreport.d/plugins.d/obmcconsole
@@ -6,7 +6,13 @@
. $DREPORT_INCLUDE/functions
-desc="OBMC console log"
-file_name="/var/log/obmc-console.log"
-
-add_copy_file "$file_name" "$desc"
+default_desc="OBMC console log"
+for file_name in /var/log/obmc-console*; do
+ desc=${default_desc}
+ if [ "$file_name" != "/var/log/obmc-console.log" ]; then
+ name=${file_name/\/var\/log\/obmc-console-/}
+ name=${name/.log/}
+ desc="OBMC Console $name log"
+ fi
+ add_copy_file "$file_name" "$desc"
+done