linux脚本:nmon安装步骤

nmon在liunx安装脚本

#!/bin/bash
#Please upload the nmon archive file to /home/aff first.
#Check if the nmon file archive exists in the /home/aff/ directory.
if [ ! -f /home/aff/nmon_linux_14i.tar.gz ];then 
echo "The nmon archive file is not exist,please download first."
exit 1
fi

#create nmon work directory.
mkdir /home/aff/nmon 

#create nmon capture data directory.
mkdir /home/aff/nmon/capture

#Unzip and install the nmon file archive to the nmon working directory.
tar -zxvf /home/aff/nmon_linux_14i.tar.gz -C /home/aff/nmon
mv /home/aff/nmon/nmonmerge_x86_sles11 nmon
chmod a+x /home/aff/nmon/nmon

#Set environment variables and take effect.
echo export PATH=$PATH:/home/aff/nmon >> /home/aff/.bashrc
echo export DATA_DIR=/home/aff/nmon/capture >> /home/aff/.bashrc
source /home/aff/.bashrc

#Enter the nmon test to see if it works
nmon

nmon 安装步骤

#1、使用aff用户上传nmon包到 /aff/home/
#2、创建nmon工作目录 mkdir /home/aff/nmon
#3、创建nmon捕获数据存放目录 mkdir /home/aff/nmon/capture
#3、解压nmon包到/home/aff/nmon tar -zxvf /home/aff/nmon_linux_14i.tar.gz -C /home/aff/nmon
#4、重命名nmonmerge_x86_sles11到nmon mv /home/aff/nmon/nmonmerge_x86_sles11 nmon
#5、配置用户变量 echo PATH=$PATH:/home/aff/nmon/nmon >> /home/aff/.bashrc && echo DATA_DIR=/home/aff/nmon/capture >> /home/aff/.bashrc
#6、使变量立即生效 source /home/aff/.bashrc
#7、测试输入nmon是否可正常运行 nmon

你可能感兴趣的:(linux)