对服务器硬件的监控

#!/bin/bash
CPU=`mpstat`
echo "CPU信息是:${CPU}"

NEICUN=`free -m | grep Mem | awk '{print $4}'`
echo "内存剩余使用率为:${NEICUN}"

IP=`ping -c 1 192.168.111.137`
echo "网络为:${IP}"

JK=`netstat -lptnu|grep 8080`
echo "监控mysql服务:${JK}"

JC=`df -Th|grep sda|awk '{print $(NF-1)}'|awk -F '%' '{print $1}'`
echo "输出结果为:${JC}"

echo "hello"|mail -s "测试" 用户名@qq.com

JK=`iostat -d -k -t 1 1`
echo "输出结果为:${JK}"

echo $PATH

JG=`uname -a`
echo "输出结果为:{JG}"

BAN=`cat /etc/redhat-release`
echo "检查版本,结果为:${BAN}"

TJ=`ifconfig |grep netmask|awk '{print $2}'|head -n1`
echo "统计信息,输出结果为:${TJ}"

SUO=`ps -ef`
echo "查看所有进程:${SUO}"

BAIDU=`curl -I http://www.baidu.com`
echo "输出结果:BAIDU"

  

上一篇:触发器的次态


下一篇:worker.properties配置