Write scripts daily inspection

#! / bin / bash 
a ************* ***************** ************* ********************** echo "########################## ########system message######################################## ##### " os_type =` uname` OS_VSR CAT = `/ etc / RedHat-release` OS_KER the uname =` -a | awk '{}. 3 Print $' ` OS_TIME DATE + =% F_%` T ` OS_RUN_TIME =` Uptime | awk '{Print $. 3}' ` OS_LAST_ERBOOT_TIME =` WHO -b | awk '{Print $ 2, $. 3}' ` OS_HOSTNAME =` hostname` echo "system type: $ os_type" echo "system version: $ OS_VSR" echo " kernel: $ OS_KER " echo" current time: $ OS_TIME " echo" running time: $ OS_RUN_TIME " echo" the last restart time: $ OS_LAST_ERBOOT_TIME " echo" The machine name: $ OS_HOSTNAME " Two ************** *************** ******************** ** echo "################################## hardware information ############ ############################# " CPUID =` grep "PHYSICAL the above mentioned id" / proc / cpuinfo | the Sort | uniq | WC the -l ` CPUCORES =` grep "Cores" / proc / cpuinfo | Sort | the uniq | awk -F: 'Print $ {2}' ` CPUMODE =` grep "Model name" / proc / cpuinfo | Sort | the uniq | awk -F: ' {Print $ 2} ' ` echo" number of the CPU: $ the CPUID " echo" the CPU core: $ CPUCORES " echo" the CPU type: $ CPUMODE " MemTotal =` Free -m | grep Mem | awk' {Print $ 2} ' ` MemFree = Free -m `| grep Mem | awk '{}. 4 Print $'` echo "total memory capacity: $ {} MemTotal MB" echo "remaining memory capacity: $ {MEMFREE} MB"

  

Guess you like

Origin www.cnblogs.com/liushuqing/p/11604724.html