Chinaunix
标题:
solaris下性能监测的一个脚本
[打印本页]
作者:
快乐南海
时间:
2006-06-01 10:00
标题:
solaris下性能监测的一个脚本
1 启动操作记录命令,记录下所有操作及输出结果
#script /perf-mon-config.log
2 创建性能监测脚本文件/perfmon.sh
#vi perfmon.sh
date >> /DH_pw450_perf_`hostname`_`date +%m%d`.log
echo "this is iostat's output" >>/DH_pw450_perf_`hostname`_`date +%m%d`.log
iostat -xnp 2 5 >> /DH_pw450_perf_`hostname`_`date +%m%d`.log
echo "this is mpstat's output" >>/DH_pw450_perf_`hostname`_`date +%m%d`.log
mpstat 2 5 >> /DH_pw450_perf_`hostname`_`date +%m%d`.log
echo "this is vmstat's output" >>/DH_pw450_perf_`hostname`_`date +%m%d`.log
vmstat 2 5 >> /DH_pw450_perf_`hostname`_`date +%m%d`.log
3 改变文件属性
#chmod 777 /perfmon.sh
4 编辑root用户的crontab文件
#cd /var/spool/cron/crontabs
#vi root
增加以下一行
30 * * * * /perfmon.sh
5 重启cron进程
#/etc/rc2.d/S75cron stop
#/etc/rc2.d/S75cron start
#crontab -l root
4 结束操作记录命令
#exit
本文来自ChinaUnix博客,如果查看原文请点:
http://blog.chinaunix.net/u/11327/showart_121359.html
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2