Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux system inspection script

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

#! / bin/bash# auth:Bertram# created Time: 2019-12-2 func:sys info check# sys:centos6.x/7.x- -[$(id-u)-ne 0] & & echo "Please execute this script with the root user!" & & exit 1sysversionmakers $(rpm-Q centos-release | cut-d-- f3) line= "- -" [- d logs] | | mkdir logs#sys_check_file= "logs/$ (ip a show dev eth0 | grep-w inet | awk'{print $2}'| awk-F'/'{print $1}')-`date +% Y% m% d`.txt "sys_check_file=" logs/$ (ifconfig | awk 'NR==2 {print $2}')-`date +% Y% m% d`.txt "# get system cpu information function get_cpu_info () {Physical_CPUs=$ (grep" physical id "/ proc/cpuinfo | sort | uniq | wc-l) Virt_CPUs=$ (grep" processor "/ proc/cpuinfo | wc-l) CPU_Kernels=$ (grep" cores "/ proc/cpuinfo | uniq | uniq | Awk-F':'{print $2}') CPU_Type=$ (grep "model name" / proc/cpuinfo | awk-F':'{print $2}'| sort | uniq) CPU_Arch=$ (uname-m) # echo-e'\ 033 [32m CPU Information:\ 033 [0m'echo-e'\ 033 [05] 32m CPU information:\ 033 [0m'cat

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report