dreport: add active services (systemd) status to the BMC dump
Generate the status of the active services "systemctl status --all"
and add it to the dump.
Tested:
State: degraded
Jobs: 0 queued
Failed: 3 units
Since: Wed 2022-03-30 03:17:48 UTC; 7min ago
CGroup: /
├─sys-kernel-debug.mount
├─sys-kernel-config.mount
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Change-Id: I45cef0ccfd4c86711a64bf5dcacb04f89bc5b50d
diff --git a/tools/dreport.d/plugins.d/servicestatus b/tools/dreport.d/plugins.d/servicestatus
new file mode 100644
index 0000000..a631f81
--- /dev/null
+++ b/tools/dreport.d/plugins.d/servicestatus
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# config: 2 60
+# @brief: Collect services status information.
+#
+
+. $DREPORT_INCLUDE/functions
+
+desc="services status list"
+file_name="services_status.txt"
+
+command="systemctl status --all"
+
+add_cmd_output "$command" "$file_name" "$desc"