【性能测试】:操作NMON的shell脚本

时间:2024-04-07 16:34:31

nmon是监控服务器的一个工具,可以自动生成快照,每次执行命令就可以了

这里写了一个小的shell脚本,练习一下

#!/bin/sh
OSType=`uname`
#判断系统类型,选择不同命令
if [ $OSType = "Linux" ];then
if [ -x "nmon" ];then
./nmon -s ${} -c ${} -t -F ${}_${}_$(date +%y%m%d%H%M%S).nmon
echo "${1}"
echo "${2}"
echo "${3}"
echo "${4}"
else
echo "you need to put the file of nmon to this path,or chmod +x nmon"
fi
elif [ $OSType != "Linux" ];then
nmon -s ${} -c ${} -t -F ${}_${}_$(date +%y%m%d%H%M%S).nmon
fi