1.下载nmon
wget https://sourceforge.net/projects/nmon/files/nmon16d_x86.tar.gz/download
2.安装nmon
mkdir /usr/local/src/nmon/
mv nmon16d_x86.tar.gz /usr/local/src/nmon/
cd /usr/local/src/nmon/
tar -xzvf nmon16d_x86.tar.gz
选择与系统对应版本的nmon
例如redhat 7.2
chmod +x nmon16g_x86_rhel72
mv nmon16g_x86_rhel72 nmon
3.定时每天出监控记录并清理
mkdir /var/nmonlog/
mkdir /data/nmonlog
vi /var/nmonlog/delete_nmon.sh
find /data/nmonlog -mtime +90 -name "*.nmon" -exec rm -rf {} \;
cd /var/nmonlog/
chmod +x delete_nmon.sh
crontab -e
59 23 * * * /usr/local/src/nmon/nmon -f -N -m /data/nmonlog -s 10 -c 8640
0 3 * * * /bin/bash /var/nmonlog/delete_nmon.sh