Charles Short 87dd74faf0 debian: Create debian version of collect
Debian and Centos use the same tools but they are installed
in different places. In order for collect to work on Debian,
make sure that we are trying not use to RPMs on Debian. This
is done in the collect-patching script so that the "smart"
program is not run.

Also kdump uses the /var/lib/kdump path on Debian rather
than /var/crash on Centos.

Also checked for 'rpm -qa' usage and changed them to 'dpkg -l'.

Test Plan
PASS Build package
PASS Build and install ISO
PASS Run the collect -v -all

Story: 2009101
Task: 43732

Depends-On: https://review.opendev.org/c/starlingx/tools/+/838327

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I66cf0615f8cab7fe877b6cb09d605557c9258c43
2022-04-19 10:21:23 -04:00

44 lines
1.0 KiB
Bash

#! /bin/bash
#
# 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="alarms"
LOGFILE="${extradir}/${SERVICE}.info"
function is_service_active {
active=`sm-query service management-ip | grep "enabled-active"`
if [ -z "$active" ] ; then
return 0
else
return 1
fi
}
###############################################################################
# Only Controller
###############################################################################
if [ "$nodetype" = "controller" ] ; then
is_service_active
if [ "$?" = "0" ] ; then
exit 0
fi
echo "${hostname}: System Alarm List .: ${LOGFILE}"
# These go into the SERVICE.info file
delimiter ${LOGFILE} "fm alarm-list"
fm alarm-list 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
delimiter ${LOGFILE} "fm event-list --nopaging"
fm event-list --nopaging 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
fi
exit 0