LINUX 巡检脚本(简化版)
#/bin/bash
# Lnux Check Script
#v0019417
#
dat=`date +%Y-%m-%d`
mem=`free -m |grep "Mem" |awk -F ' ' '{print $2}'`
vers=`cat /etc/redhat-release`
ipp=`ifconfig |grep 'inet addr' |grep -v '127.0.0.1' |awk -F ' ' '{print $2}' |awk -F ':' '{print $2}' |sed -n 1p`
hn=`hostname`
pycpu=`cat /proc/cpuinfo | grep "physical id"|sort | uniq | wc -l`
locpu=`cat /proc/cpuinfo | grep "processor"| wc -l`
centosversion=`awk '{print $(NF-1)}' /etc/redhat-release`
resultfile="/tmp/${hn}_${dat}_${ipp}.txt"
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| awk -F ': ' '{print $2}'`
CPU_Type=`grep "model name" /proc/cpuinfo | awk -F ': ' '{print $2}' | sort | uniq`
CPU_Arch=`uname -m`
SELinux=`/usr/sbin/sestatus | grep "SELinux status: " | awk '{print $3}'`
uptime=`uptime | sed &