LoadRunner針對Centos實施監控

1.安裝 xinetd 

        yum -y install xinetd  


2. 安裝rsh 

     注:以下安裝的rsh-server、rsh、rstatd包如果不能通過wget下載,可以在51cto下載中心下載,地址如下:

       http://down.51cto.com/data/1322433

  •   從如下地址去下載

   wget ftp://ftp.muug.mb.ca/mirror/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/rsh-server-0.17-14.i386.rpm  

  •   安裝rsh服務器rpm包

   rpm -ivh rsh-server-0.17-14.i386.rpm --force --nodeps  

  •   下載rsh客戶端rpm包

   wget ftp://ftp.muug.mb.ca/mirror/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/rsh-0.17-14.i386.rpm  

  •   安裝rsh客戶端rpm包

   rpm -ivh rsh-0.17-14.i386.rpm --force --nodeps  

3. 安裝 rstatd 

第1種方式安裝rstatd

   wget http://nchc.dl.sourceforge.net/project/rstatd/rstatd/4.0.1/rpc.rstatd-4.0.1.tar.gz  

   下載後按下面的內容解壓與安裝

    # tar –xzvf rpc.rstatd-4.0.1.tar.gz 

    # ./configure ---配置 

    # make ---編譯 

    # make install ---安裝 


  第2種方式安裝rstatd

    yum install rusers-server

    運行如下方式來查看是否已經將 rusers-server 裝上了(如妹結果還需)

    yum search rusers-server

       通過 rpcinfo -p 來查看是否已經有 rstatd 服務啓動了啓動的結果如下所示:

          [root@locathost init.d]# rpcinfo -p

       program vers proto   port  service

        100000    4   tcp    111  portmapper

        100000    3   tcp    111  portmapper

        100000    2   tcp    111  portmapper

        100000    4   udp    111  portmapper

        100000    3   udp    111  portmapper

        100000    2   udp    111  portmapper

        100024    1   udp  37276  status

        100024    1   tcp  51722  status

        100001    3   udp    991  rstatd

        100001    2   udp    991  rstatd

        100001    1   udp    991  rstatd

        100011    1   udp    875  rquotad

        100011    2   udp    875  rquotad

        100011    1   tcp    875  rquotad

        100011    2   tcp    875  rquotad

      如果沒有,那麼到init.d下啓動,命令如下

       /etc/init.d/./rstatd start

      命令擴展啓動 (./rstatd {start|stop|status|rstart})

4. 配置 xinetd.conf 

    vi /etc/xinetd.conf   

    

        #

        # This is the master xinetd configuration file. Settings in the

        # default section will be inherited by all service configurations

        # unless explicitly overridden in the service configuration. See

        # xinetd.conf in the man pages for a more detailed explanation of

        # these attributes.

        

        defaults

        {

        # The next two items are intended to be a quick access place to

        # temporarily enable or disable services.

        #

        #enabled=

        #disabled=

        

        # Define general logging characteristics.

        log_type= SYSLOG daemon info 

        log_on_failure= HOST

        log_on_success= PID HOST DURATION EXIT

        

        # Define access restriction defaults

        #

        #no_access=

        #only_from=

        #max_load= 0

        cps= 50 10

        #instances= 50

        #per_source= 10

        instances= 30

        per_source= 50 10

        

        # Address and networking defaults

        #

        #bind=

   


5. 分別修改/etc/xinetd.d/下的三個conf文件 

       rlogin ,rsh,rexec 這三個配置文件, 

      將這三個文件裏面的Disable = yes都改成 Disable = no 

      或是把# default: off都設置成 on ,並把“#”去掉,這個的意思就是在xinetd啓動的時候默認都啓動上面的三個服務! 

     例如rlogin的內容 

                如下標紅的地方修改一處即可    

        # default: on

        # description: rlogind is the server for the rlogin(1) program.  The server \

        #provides a remote login facility with authentication based on \

        #privileged port numbers from trusted hosts.

        service login

        {

        socket_type= stream

        wait= no

        user= root

        log_on_success+= USERID

        log_on_failure += USERID

        server= /usr/sbin/in.rlogind

        #disable= yes

        disable = no

        }


6. 啓動 xinetd 

    service xinetd start  

   確認啓動 

  netstat -an |grep 514     

結果:

Java代碼   

1.tcp        0      0 0.0.0.0:514                 0.0.0.0:*                   LISTEN  

7. 啓動 rstatd 

  •    rpc.rstatd  

  •   rpc.rquotad  


8.確認啓動: 

    rpcinfo -p  


結果: 

[root@locathost init.d]# rpcinfo -p

   program vers proto   port  service

    100000    4   tcp    111  portmapper

    100000    3   tcp    111  portmapper

    100000    2   tcp    111  portmapper

    100000    4   udp    111  portmapper

    100000    3   udp    111  portmapper

    100000    2   udp    111  portmapper

    100024    1   udp  37276  status

    100024    1   tcp  51722  status

    100001    3   udp    991  rstatd

    100001    2   udp    991  rstatd

    100001    1   udp    991  rstatd

    100011    1   udp    875  rquotad

    100011    2   udp    875  rquotad

    100011    1   tcp    875  rquotad

    100011    2   tcp    875  rquotad

9. 關閉防火牆服務  

  service iptables stop  

 配置loadrunner unix監控輸入服務器ip即可 如下圖:

 wKioL1OX9-2hdgJBAAIWde8ljGE353.jpg


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