Merge "Add new log to the device and interface info files."
This commit is contained in:
commit
025fe6bd08
|
@ -51,6 +51,8 @@ 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 collect_containerization.sh %{buildroot}%{_sysconfdir}/collect.d/collect_containerization
|
||||
install -m 755 collect_dc.sh %{buildroot}%{_sysconfdir}/collect.d/collect_dc
|
||||
install -m 755 collect_disk.sh %{buildroot}%{_sysconfdir}/collect.d/collect_disk
|
||||
install -m 755 collect_interfaces.sh %{buildroot}%{_sysconfdir}/collect.d/collect_interfaces
|
||||
|
||||
install -m 755 etc.exclude %{buildroot}%{_sysconfdir}/collect/etc.exclude
|
||||
install -m 755 run.exclude %{buildroot}%{_sysconfdir}/collect/run.exclude
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# Copyright (c) 2020 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="disk"
|
||||
LOGFILE="${extradir}/${SERVICE}.info"
|
||||
|
||||
###############################################################################
|
||||
# Disk Info
|
||||
###############################################################################
|
||||
|
||||
echo "${hostname}: Disk Info .: ${LOGFILE}"
|
||||
|
||||
for device in $(lsblk -l -o NAME,TYPE,TRAN | grep -v usb | grep -e disk | cut -d ' ' -f1); do
|
||||
delimiter ${LOGFILE} "smartctl -a ${device}"
|
||||
smartctl -a "/dev/${device}" >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
||||
done
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,34 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# Copyright (c) 2020 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="interface"
|
||||
LOGFILE="${extradir}/${SERVICE}.info"
|
||||
|
||||
###############################################################################
|
||||
# Interface Info
|
||||
###############################################################################
|
||||
|
||||
echo "${hostname}: Interface Info .: ${LOGFILE}"
|
||||
|
||||
delimiter ${LOGFILE} "ip link"
|
||||
ip link >> ${LOGFILE}
|
||||
|
||||
for i in $(ls /sys/class/net/); do
|
||||
delimiter ${LOGFILE} "ethtool -i ${i}"
|
||||
ethtool -i ${i} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
||||
|
||||
delimiter ${LOGFILE} "ethtool -S ${i} | grep -v ': 0'"
|
||||
ethtool -S ${i} | grep -v ": 0" >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
||||
done
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue