UnixBench是常见的Linux/Unix平台下测试系统性能的测试工具,安装脚本如下:
#!/bin/bash
yum install vimyum install mlocate
mkdir /home/tools/scp 10.0.0.11:/home/cloudtest/tools/* /home/tools/cd /home/tools/
tar zxvf unixbench-5.1.2.tar.gzcd unixbench-5.1.2
sed -i 's/GRAPHIC_TESTS = defined/#GRAPHIC_TESTS = defined/g' /home/tools/unixbench-5.1.2/Makefile
(注释掉Makefile中GRAPHIC_TESTS = defined这一行,Makefile的路径就是/home/tools/unixbench-5.1.2,sed命令的用法见 和。)
yum install makeyum install gccyum install perlyum install perl-Time-HiRes
(安装perl时若产生系统报错,Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./Run line 6.,就是因为没有装perl-Time-HiRes,详见)
cd /home/tools/unixbench-5.1.2/
echo "unixbench completed..."
执行脚本文件后,就在虚拟机上成功安装了unixbench。
运行unixbench:
[root@centos62server unixbench-5.1.2]# ./Run
测试结果如下: