pablo bovina e7e0ecfab9 Add new logs to the alarm info file
Add new log to the alarm.info generated
by the output of:
	fm event-list --nopaging

Story: 2008452
Task: 41435

Change-Id: Ic7ea6c33e79b846058723dc1023797526ceeb7af
Signed-off-by: Pablo Bovina <pablo.bovina@windriver.com>
2020-12-16 16:48:12 -03: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