redhat5.4安装配置nmon

结论:

1,c语言的扩展名为.c的源文件可以使用cc或gcc编译器进行编译后,变成可执行文件
2,gcc或cc编译时,需要另一个文件makefile
3,makefile里面就是一个用于编译环境的配置信息,里面记录了各个操作系统平台和CPU处理器内核的配置信息
4,如何makefile里面没有你当前数据库版本的配置信息,需要你添加对应的操作系统配置信息
5,编译指令为 
     cc -o nmon_x86_64_rhel54 lmon.c -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -g
   (可以不需要makefile文件也可以用上述指令编译成功)
6,上述第5步运行编译期间若报没有ncurses.h,请安装ncurses-devel开发包即可

测试过程

1,操作系统版本
[root@seconary ~]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[root@seconary ~]#

2,下载redhat5.4 nmon安装介质
http://sourceforge.net/projects/nmon/files




3,上传nmon安装介质
[root@seconary ~]# mkdir -p /nmon_test
[root@seconary ~]# cd /nmon_test/
[root@seconary nmon_test]#


4,安装编译nmon
[root@seconary nmon_test]# ll
total 196
-rwxrwxrwx 1 root root 185939 Aug 10 2010 lmon14a.c
-rwxrwxrwx 1 root root 4154 May 3 10:37 makefile


5,重命名上述头文件lmon14a.c
[root@seconary nmon_test]# mv lmon14a.c lmon.c


6,makefile文件添加如下2行新内容(添加一直报错),其实就是编译要用到makefile文件
[root@seconary nmon_test]# tail -2f makefile
cc -o nmon_x86_64_rhel54 $(FILE) $(CFLAGS) $(LDFLAGS) -D X86
cc -o nmon15cs lmon15c_stealing.c $(CFLAGS) $(LDFLAGS) -D X86


7,编译报错
[root@seconary nmon_test]# make nmon_x86_rhel54
gcc44 -o nmon_x86_rhel54 lmon.c -g -O3 -D JFS -D GETUSER -Wall -D LARGEMEM -lm -lncurses -g -D X86
make: gcc44: Command not found
make: *** [nmon_x86_rhel54] Error 127


8,修改makefile对应部分,gcc44改为gcc(很简单因为找不到gcc44,所以改为gcc)
nmon_x86_rhel54: $(FILE)
gcc -o nmon_x86_rhel54 $(FILE) $(CFLAGS) $(LDFLAGS) -D X86


9,再次编译报错
[root@seconary nmon_test]# cc -o nmon_x86_64_rhel54 lmon.c -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -g
lmon.c:35:21: error: ncurses.h: No such file or directory


10,已经安装了ncurses软件包
[root@seconary nmon_test]# rpm -qa|grep ncurses
ncurses-5.5-24.20060715
ncurses-5.5-24.20060715
[root@seconary nmon_test]#


11,加载操作系统 光盘
[root@seconary Server]# mount /dev/cdrom /mnt
[root@seconary Server]# pwd
/mnt/Server


12,可见已经安装了ncurses软件包,但没有安装ncurses-devel软件包
[root@seconary Server]# ll -l *curse*
-r--r--r-- 348 root root 1183178 Jan 18 2007 ncurses-5.5-24.20060715.i386.rpm
-r--r--r-- 141 root root 1209755 Jan 18 2007 ncurses-5.5-24.20060715.x86_64.rpm
-r--r--r-- 333 root root 1709697 Jan 18 2007 ncurses-devel-5.5-24.20060715.i386.rpm
-r--r--r-- 141 root root 1790863 Jan 18 2007 ncurses-devel-5.5-24.20060715.x86_64.rpm
-r--r--r-- 135 root root 42838 Mar 25 2009 php-ncurses-5.1.6-23.2.el5_3.x86_64.rpm
[root@seconary Server]# rpm -qa|grep ncurse
ncurses-5.5-24.20060715
ncurses-5.5-24.20060715




13,进行安装ncurses-devel软件包
安装了ncurses-devel还是找不到curse.h的头文件
[root@seconary Server]# rpm -ivh ncurses-devel-5.5-24.20060715.x86_64.rpm
Preparing... ########################################### [100%]
1:ncurses-devel ########################################### [100%]
[root@seconary Server]#
[root@seconary Server]#
[root@seconary Server]# locate curses.h
[root@seconary Server]# locate ncurses.h
[root@seconary Server]# rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm
Preparing... ########################################### [100%]
1:ncurses-devel ########################################### [100%]
[root@seconary Server]#
[root@seconary Server]#
[root@seconary Server]#
[root@seconary Server]# locate ncurses.h
[root@seconary Server]# locate curses.h


14,locate查不到头文件,但其实是存在的
[root@seconary Server]# cd /usr/include
[root@seconary include]# ll *ses*h
-rw-r--r-- 1 root root 2115 Jul 17 2009 aliases.h
lrwxrwxrwx 1 root root 16 Sep 4 03:53 curses.h -> ncurses/curses.h
lrwxrwxrwx 1 root root 17 Sep 4 03:53 ncurses.h -> ncurses/ncurses.h


15,更新locate元数据库,locate运行成功
[root@seconary include]# updatedb
You have new mail in /var/spool/mail/root
[root@seconary include]# locate curses.h
/usr/include/curses.h
/usr/include/ncurses.h
/usr/include/ncurses/curses.h
/usr/include/ncurses/ncurses.h
/usr/include/ncursesw/curses.h
/usr/include/ncursesw/ncurses.h


16,编译nmon成功
[root@seconary nmon_test]# cc -o nmon_x86_64_rhel54 lmon.c -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -g
[root@seconary nmon_test]#


17,编译成功当前目录多了一个文件nmon_x86_64_rhel54
[root@seconary nmon_test]# ll
total 416
-rwxrwxrwx 1 root root 185939 Sep 4 03:39 lmon.c
-rwxrwxrwx 1 root root 4250 Sep 4 03:34 makefile
-rwxr-xr-x 1 root root 219751 Sep 4 03:58 nmon_x86_64_rhel54





19,按n键实时监控网络性能,至于其它监控指标,请参考上述命令提示




个人简介




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-1790929/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9240380/viewspace-1790929/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
包里面有下面文件,比较全,有很多版本的nmon,解压后,找到对应版本,如我用的红帽: tar xf nmon_linux_14i.tar.gz ;cp nmon_x86_64_rhel54 /usr/bin/nmon 然后即可使用:nmon 17K nmonmerge_x86_64_debian6 22K nmonmerge_x86_64_sles11 14K nmonmerge_x86_debian6 14K nmonmerge_x86_GNU_2.0.0 18K nmonmerge_x86_GNU_2.6.15 19K nmonmerge_x86_GNU_2.6.24 14K nmonmerge_x86_puppy431 19K nmonmerge_x86_sles11 217K nmon_x86_64_centos6 223K nmon_x86_64_debian5 223K nmon_x86_64_debian6 287K nmon_x86_64_debian7 237K nmon_x86_64_fatdog64_601 276K nmon_x86_64_fedora17 282K nmon_x86_64_fedora18 286K nmon_x86_64_fedora19 287K nmon_x86_64_mint14 92 nmon_x86_64_mint14.info 350K nmon_x86_64_mint15 241K nmon_x86_64_opensuse12 221K nmon_x86_64_rhel54 235K nmon_x86_64_sles11 235K nmon_x86_64_sles11_oldest 257K nmon_x86_64_ubuntu1010 285K nmon_x86_64_ubuntu1110 350K nmon_x86_64_ubuntu13 235K nmon_x86_64_ubuntu6 235K nmon_x86_64_ubuntu7 283K nmon_x86_64_zorin6 195K nmon_x86_centos6 185K nmon_x86_debian5 185K nmon_x86_debian6 252K nmon_x86_debian7 183K nmon_x86_dsl 244K nmon_x86_fedora17 250K nmon_x86_fedora18 246K nmon_x86_fedora19 186K nmon_x86_GNU_2.0.0 211K nmon_x86_GNU_2.6.15 239K nmon_x86_GNU_2.6.24 185K nmon_x86_knoppix6 252K nmon_x86_knoppix7 294K nmon_x86_mint14 294K nmon_x86_mint15 215K nmon_x86_opensuse12 187K nmon_x86_puppy431 192K nmon_x86_sles11 192K nmon_x86_sles11_oldest 241K nmon_x86_ubuntu1110 294K nmon_x86_ubuntu13 192K nmon_x86_ubuntu6 192K nmon_x86_ubuntu7 239K nmon_x86_zorin6
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值