#!/bin/sh
source /etc/profileserverName=$1dingDingName=$2#获取内存情况memory=(`free | awk 'NR==2{print $2,$3}'`)memoryAll=${memory[0]}memoryUsed=${memory[1]}#cpu负载cpuLoad=(`cat /proc/loadavg | awk '{print $1,$2,$3,$4}'`)cpuLoad1=${cpuLoad[0]}cpuLoad5=${cpuLoad[1]}cpuLoad15=${cpuLoad[2]}cpuLoadProcess=${cpuLoad[3]}#cpu使用率cpuUsed=`/usr/bin/top -b -n 1 | awk 'NR==3 {print $2}'`#磁盘使用率disk=(`df | grep /dev/ | awk '{print $2,$3}'`)diskAll=${disk[0]}diskUsed=${disk[1]}#查看总的逻辑核数coreNum=`cat /proc/cpuinfo | grep 'model name' | wc -l`