Merge "[Enhancement] Add system active alarms in collect logs"
This commit is contained in:
commit
49bc5fb50d
@ -46,6 +46,7 @@ install -m 755 collect_patching.sh %{buildroot}%{_sysconfdir}/collect.d/collect_
|
|||||||
install -m 755 collect_coredump.sh %{buildroot}%{_sysconfdir}/collect.d/collect_coredump
|
install -m 755 collect_coredump.sh %{buildroot}%{_sysconfdir}/collect.d/collect_coredump
|
||||||
install -m 755 collect_crash.sh %{buildroot}%{_sysconfdir}/collect.d/collect_crash
|
install -m 755 collect_crash.sh %{buildroot}%{_sysconfdir}/collect.d/collect_crash
|
||||||
install -m 755 collect_ima.sh %{buildroot}%{_sysconfdir}/collect.d/collect_ima
|
install -m 755 collect_ima.sh %{buildroot}%{_sysconfdir}/collect.d/collect_ima
|
||||||
|
install -m 755 collect_fm.sh %{buildroot}%{_sysconfdir}/collect.d/collect_fm
|
||||||
|
|
||||||
install -m 755 etc.exclude %{buildroot}%{_sysconfdir}/collect/etc.exclude
|
install -m 755 etc.exclude %{buildroot}%{_sysconfdir}/collect/etc.exclude
|
||||||
install -m 755 run.exclude %{buildroot}%{_sysconfdir}/collect/run.exclude
|
install -m 755 run.exclude %{buildroot}%{_sysconfdir}/collect/run.exclude
|
||||||
|
41
tools/collector/scripts/collect_fm.sh
Normal file
41
tools/collector/scripts/collect_fm.sh
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#! /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}
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
Loading…
x
Reference in New Issue
Block a user