LoadRunner監控Linux

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服務的狀態


2012112714511973.jpg


如果未出現上圖的rstatd說明沒有安裝成功,需要重複以上步驟。

到這裏爲止,LR監控Linux必要的服務都已安裝好了。

五、關閉防火牆

[root@localhost /]#  service iptables stop

六、利用LR中的Controller監控Linux資源

  1. 在Controller中,將System Resource Graphs中的Unix resources拖到右側的資源監控區域。

  2. 鼠標右鍵選擇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進行重啓。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章