LoadRunner監控Linux
rstat協議允許網路上的使用者獲得同一網路上各機器的績效參數。
需要下載3個包:
(1)rsh-0.17-14.i386.rpm
(2)rsh-server-0.17-14.i386.rpm
(3)rpc.rstatd-4.0.1.tar.gz
一、安裝rsh
查看是否安裝並卸載rsh
[root@localhost /]# rpm –qa |grep rsh --查看是否安裝rsh
[root@localhost /]# rpm –e + 版本號碼 --卸載該版本
安裝rsh,rsh-server
[root@localhost /]# rpm –ivh rsh-0.17-14.i386.rpm
[root@localhost /]# rpm –ivh rsh-server-0.17-14.i386.rpm
二、安裝rstatd
下載並安裝rstatd,:http://sourceforge.net/projects/rstatd,上傳至/usr/local
查看是否安裝,一般來說Linux都沒有安裝
[root@localhost /]# find / -name rpc.rstatd
安裝rstatd
[root@localhost /]# tar -xzvf rpc.rstatd-4.0.1.tar.gz
[root@localhost /]# cd rpc.rstatd-4.0.1
[root@localhost /]# ./configure
[root@localhost /]# make
[root@localhost /]# make install
三、安裝完成後配置rstatd目標守護進程xinetd,設定檔於/etc/xinet.d目錄下
修改/etc/xinetd.d目錄下面的3個conf(rogin,rsh,rexec)中的disable均設定為no
[root@localhost /]# cd /etc/xinetd.d --進入到/etc/xinetd.conf目錄中
[root@localhost /]# vi rlogin --編輯disable=no,儲存
[root@localhost /]# vi rsh --編輯disable=no,儲存
[root@localhost /]# vi rexec --編輯disable=no,儲存
四、啟動rpc.rstatd
[root@localhost /]# rpc.rstatd --啟動rpc.rstatd進程
[root@localhost /]# rpcinfo -p --執行此命令檢查rpc服務的狀態
如果未出現的rstatd說明沒有安裝成功,需要重複以上步驟。
到這裡為止,LR監控Linux必要的服務都已安裝好了。
五、關閉防火牆
[root@localhost /]# service iptables stop
六、利用LR中的Controller監控Linux資源
- 在Controller中,將System Resource Graphs中的Unix resources拖到右側的資源監控地區。
- 滑鼠右鍵選擇Add Measurements,添加被監控Linux的IP地址x.x.x.x,選擇需要監控的效能指標,確認。
七、遇到的問題
1. LoadRunner監控Linux資源時彈出如下錯誤:
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.
原因:Linux系統中沒有安裝rpc.rstatd,服務未開啟的原因造成的。
解決辦法:照上述方法安裝rpc.rstatd並開啟即可監控Linux.
2. configure: error: no acceptable C compiler found in $PATH
原因:未安裝gcc編譯器. 在命令列裡敲入gcc –v, 如果提示command not found 就表示你的系統裡沒有安裝gcc編譯器
解決辦法:yum install gcc
簡單介紹監控UNIX
lr監控UNIX ,UNIX先啟動一rstatd服務
以下是在IBM AIX系統中啟動rstatd服務的方法:
1、 使用telnet以root使用者的身份登入入AIX系統
2、 在命令列提示符下輸入:vi /etc/inetd.conf
3、 尋找rstatd,找到
#rstatd sunrpc_udp udp wait root /usr/sbin/rpc.rstatd rstatd 100001 1-3
4、將#去掉
5、:wq儲存修改結果
6、命令提示字元下輸入:refresh –s inetd 重新啟動服務。
這樣使用loadrunner就可以監視AIX系統的效能情況了。
註:在HP UNIX系統上編輯完inetd.conf後,重啟inetd服務需要輸入inetd -c
UNIX上也可以用rup命令查看rstatd程式是否被配置並啟用
若rstatd程式已經運行,重啟時,先查看進程ps -ef |grep inet,然後殺掉進程,再refresh –s inetd進行重啟。