utilities/tools/collector/debian-scripts/collect_systemd.sh
Joshua Kraitberg 2ae5baf552 collector: Add systemd-analyze plot
This adds an SVG plot with stats from the startup of the system.

Test Plan:
PASS: AIO-SX, AIO-DX, DC with AIO-SX subcloud
PASS: bashate
PASS: Verify plot is in collect
PASS: Verify plot is empty if collect is run before startup is done

Story: 2010533
Task: 49983
Change-Id: I60e9538e66806e284458105f2bf36c8bfdb209e5
Signed-off-by: Joshua Kraitberg <joshua.kraitberg@windriver.com>
2024-04-26 15:32:44 -04:00

26 lines
709 B
Bash

#! /bin/bash
#
# Copyright (c) 2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Loads Up Utilities and Commands Variables
source /usr/local/sbin/collect_parms
source /usr/local/sbin/collect_utils
SERVICE="systemd"
LOGFILE="${extradir}/${SERVICE}.info"
PLOTFILE="${extradir}/${SERVICE}-startup-plot.svg"
###############################################################################
# Systemd analysis
###############################################################################
echo "${hostname}: Systemd analyze .........: ${LOGFILE}"
delimiter ${LOGFILE} "systemd-analyze plot > ${PLOTFILE}"
timeout 30 systemd-analyze plot > ${PLOTFILE} 2>>${COLLECT_ERROR_LOG}
exit 0