Linux 查看链接数: linux
netstat -tn | grep 126 | awk '/^tcp/{++state[$NF]} END {for(key in state) print key ,"t", state[key]}'
网络
一 简述:LoadRunner监控Linux资源时弹出以下错误: app
Monitor name :UNIX Resources. Cannot initialize the monitoring on 192.168.52.189. Error while creating the RPC client. Ensure that the machine can be connected and that it runs the rstat daemon (use rpcinfo utility for this verification). Detailed error: RPC: Failed to create RPC client.
RPC-TCP: Failed to establish RPC server address. ssh
上述问题的实质是Linux系统中未安装rpc.rstatd,服务未开启的缘由形成。 tcp
首先查看rpc.rstatd是否安装
[root@localhost bin]# whereis rpc.rstatd
备注:rstatd Rstat协议容许网络上的用户得到同一网络上各机器的性能参数。 性能
二 准备下载包:下载rpc.rstatd-4.0.1.tar.gz安装包 this
下载地址:http://sourceforge.net/projects/rstatd 利用ssh客户端上传rpc.rstatd-4.0.1.tar.gz包至Linux下/home/目录下 spa
三 执行安装程序包: .net
chmod 777 rpc.rstatd-4.0.1.tar.gz //将文件赋予rwx权限 server
tar -xzvf rpc.rstatd-4.0.1.tar.gz //解压rcp.rstatd
cd rpc.rstatd-4.0.1 //进入到rpc.rstatd目录中
./configure //配置rc.rstatd的安装,如下个人是按照默认方式的,注:linux需安装C编译器
make //编译rc.rstatd
make install // 安装
四 启动rpc.rstatd和检测
rpc.rstatd //启动rpc.rstatd进程
rpcinfo –p // 执行此命令检查rpc服务的状态
[root@localhost xinetd.d]# rpcinfo -p
程序版本协议 端口
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 32768 status
100024 1 tcp 32769 status
100001 5 udp 867 rstatd
100001 3 udp 867 rstatd
100001 2 udp 867 rstatd
100001 1 udp 867 rstatd
五 利用Loadunner中的Controller监控Linux资源
1 在controller中,将Systeme Resourece Graphs中的UNIX resources拖到右键的资源监控区域
2 鼠标右键选择Add Measurements,添加被监控linux的IP地址,选择需监控的性能指标,确认。