服务器宕机硬件信息收集
软件信息
华为、烽火使用 InfoCollect
浪潮、曙光使用 InspurDiagLogCollect
戴尔、惠普使用 sosreport
软件路径
hostname:/home/appuser/systeminfo
InfoCollect_Linux0525_HuaWei.tar、InspurDiagLogCollect_Linux_V5.1.9_20200318-langcao.zip
文件远程拷贝使用
方法:scp -P 端口 文件 目标用户+目标路径
scp -P 22 InfoCollect_Linux0525_HuaWei.tar user@ostname:/home/user
InfoCollect使用
- 解压文件并进入
cd InfoCollect_Linux - 命令后台执行
nohup sh infoCollect.sh & - 硬件信息路径
收集日志存在于InfoCollect_Linux - 解压文件并重命名文件(避免ip)
- 删除安全信息
find ./* -type f |xargs sed -i 's/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/0.0.0.0/g'
find . -type f |xargs sed -i 's/js[a-z]*[-]*[0-9]*/localhost/g'
find ./ -name hosts*;find ./ -name ntp*;find ./ -name reslove*;find ./ -name *oos*
find . -name host* -exec rm -rf system/etc/hosts \;
find . -name ntp -exec rm -rf system/etc/ntp \;
find . -name ntp.conf -exec rm -rf system/etc/ntp.conf \;
find . -name reslove* -exec rm -rf system/etc/resolv* \;
LogCollect使用
- 解压文件并进入LogCollect目录
cd InspurDiagLogCollect_Linux_V5.1.9_20200318 - 命令后台执行
nohup sh run.sh & - 硬件信息路径
收集信息存在于InspurDiagLogCollect_Linux_V5.1.9_20200318/all_logs - 解压文件并重命名文件(避免ip)
- 删除安全信息
find ./* -type f |xargs sed -i 's/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/0.0.0.0/g'
find . -type f |xargs sed -i 's/js[a-z]*[-]*[0-9]*/localhost/g'
find ./ -name hosts*;find ./ -name ntp*;find ./ -name reslove*;find ./ -name *oos*
find . -name host* -exec rm -rf system/etc/hosts \;
find . -name ntp -exec rm -rf system/etc/ntp \;
find . -name ntp.conf -exec rm -rf system/etc/ntp.conf \;
find . -name reslove* -exec rm -rf system/etc/resolv* \;
sosreport
戴尔、惠普
sosreport -a --report
这条命令正常情况下会在几分钟里完成。根据本地配置,在某些情况下,某些选项可能需要更长的时间才能完成。一旦完成,sosreport将在/ tmp目录目录中生成一个压缩文件。不同版本使用不同的压缩方案(** gz,bz2,或xz**)。该文件应提供给红帽的支持代表(在开放的情况下通常作为附件)。
注意:sosreport需要root权限才能运行
删除安全信息
find ./* -type f |xargs sed -i 's/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/0.0.0.0/g'
find . -type f |xargs sed -i 's/js[a-z]*[-]*[0-9]*/localhost/g'
find ./ -name hosts*;find ./ -name ntp*;find ./ -name reslove*;find ./ -name *oos*
find . -name host* -exec rm -rf system/etc/hosts \;
find . -name ntp -exec rm -rf system/etc/ntp \;
find . -name ntp.conf -exec rm -rf system/etc/ntp.conf \;
find . -name reslove* -exec rm -rf system/etc/resolv* \;
浙公网安备 33010602011771号