Chinaunix首页 | 论坛 | 博客
  • 博客访问: 46641
  • 博文数量: 20
  • 博客积分: 890
  • 博客等级: 准尉
  • 技术积分: 230
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-26 12:32
文章分类

全部博文(20)

文章存档

2009年(20)

我的朋友
最近访客

分类: 系统运维

2009-11-26 13:32:41

Loadrunner几乎可以监控所有的主流系统平台,监控windows系统的资源最为方便,下面就说一下监控windows系统资源的方法。

要监控系统资源就要先确定被监控系统的Network DDE,Remote Registry和Net Logon这三个服务是否是启动状态,剩下的事情就简单了。

在Controller的场景监控界面里面的Windows Resources上面点右键Add Measuremens

然后添加要监控主机的IP地址(Add Machine)就行了。

在添加linux监控时,ip后面要加上端口号,可以通过rpcinfo -p命令来得到端口,如果不则访问的默认端口514.

在添加主机的下面就是监控的各项参数,下表就是各项参数对应的监视内容。

Object

Measurement

Description

System

% Total Processor

Time

The average percentage of time that all the processors on the system are busy executing non-idle threads. On a multiprocessor system, if all processors are always busy, this is 100%, if all processors are 50% busy this is 50% and if 1/4 of the processors are 100% busy this is 25%. It can be viewed as the fraction of the time spent doing useful work. Each processor is assigned an Idle thread in the Idle process which consumes those unproductive processor cycles not used by any other threads.

System

File Data

Operations/sec

The rate at which the computer issues read and write operations to file system devices.This does not include File Control Operations.

Processor

% Processor Time

(Windows 2000)

The percentage of time that the processor is executing a non-idle thread. This counter was designed as a primary indicator of processor activity. It is calculated by measuring the time that the processor spends executing the thread of the idle process in each sample interval, and subtracting that value from 100%. (Each processor has an idle thread which consumes cycles when no other threads are ready to run). It can be viewed as the percentage of the sample interval spent doing useful work. This counter displays the average percentage of busy time observed during the sample interval. It is calculated by monitoring the time the service was inactive, and then subtracting that value from 100%.

System

Processor Queue

Length

The instantaneous length of the processor queue in units of threads. This counter is always 0 unless you are also monitoring a thread counter. All processors use a single queue in which threads wait for processor cycles. This length does not include the threads that are currently executing. A sustained processor queue length greater than two generally indicates processor congestion. This is an instantaneous count, not an average over the time interval.

Memory

Page Faults/sec

This is a count of the page faults in the processor. A page fault occurs when a process refers to a virtual memory page

that is not in its Working Set in the main memory. A page fault will not cause the page to be fetched from disk if that page is on the standby list (and hence already in main memory), or if it is in use by another process with which the page is shared.

PhysicalDisk

% Disk Time

The percentage of elapsed time that the selected disk drive is busy servicing read or write requests.

Memory

Pool Nonpaged Bytes

The number of bytes in the nonpaged pool, a system memory area where space is acquired by operating system components as they accomplish their appointed tasks.Nonpaged pool pages cannot be paged outto the paging file. They remain in main memory as long as they are allocated.

Memory

Pages/sec

The number of pages read from the disk or written to the disk to resolve memory references to pages that were not in memory at the time of the reference. This is the sum of Pages Input/sec and Pages Output/sec. This counter includes paging traffic on behalf of the system cache to access file data for applications. This value also includes the pages to/from non-cached mapped memory files. This is the primary counter to observe if you are concerned about excessive memory pressure (that is,thrashing), and the excessive paging that may result.

System

Total Interrupts/sec

The rate at which the computer is receiving and servicing hardware interrupts. The devices that can generate interrupts are the system timer, the mouse, data

communication lines, network interface cards, and other peripheral devices. This counter provides an indication of how busy these devices are on a computer-wide basis. See also Processor:Interrupts/sec.

Objects

Threads

The number of threads in the computer at the time of data collection. Notice that this is an instantaneous count, not an average over the time interval. A thread is the basic

executable entity that can execute instructions in a processor.

Process

Private Bytes

The current number of bytes that the process has allocated that cannot be shared with other processes.

· loadrunner监视linux服务器的安装与操作 

 

 根据网上资料加自己的安装心得,整理如下:

一.安装rsh,和rsh-server两个服务包。

1. 卸载rsh

rpm –q rsh----------查看版本号

rpm  -e 版本号---------卸载该版本。

 

2.安装

rpm -ivh rsh-0.17-559.i586.rpm

rpm -ivh rsh-server-0.17-559.i586.rpm

 注:如果不安装rsh,在后面的/etc/xinetd.d/目录下将没有rlogin ,rshrexec 这三个配置文件。

 

二. 下载并安装rstatd

1.得到安装包rpc.rstatd- 4.0.1.tar.gz

 第一步:解压tar –xvf rpc.rstatd-4.0.1.tar.gz

 第二步:配置 ./configure

 第三步:编译 make

 第四步:安装 make install

 第五步:启动rstatd进程 rpc.rstatd

· .安装完成后配置rstatd 目标守护进程xinetd,它的主配置文件是/etc/xinetd.conf ,它里面内

容是一些如下的基本信息:

# xinetd.conf

#

# Copyright (c) 1998-2001 SuSE GmbH Nuernberg, Germany.

# Copyright (c) 2002 SuSE Linux AG, Nuernberg, Germany.

#

 

defaults

{

        log_type        = FILE /var/log/xinetd.log

        log_on_success  = HOST EXIT DURATION

        log_on_failure  = HOST ATTEMPT

#        only_from       = localhost

        instances       = 30

        cps             = 50 10

 

#

# The specification of an interface is interesting, if we are on a firewall.

# For example, if you only want to provide services from an internal

# network interface, you may specify your internal interfaces IP-Address.

· #

#       interface       = 127.0.0.1

 

}

 

includedir /etc/xinetd.d

· 关于LR监视Windows和linux的说明

一 windows

1 监视连接前的准备工作
         首先保证被监视的windows系统开启以下二个服务Remote Procedure Call(RPC)

和Remote Registry Service (这里具体在那里开起服务就不说了)。
         被监视的WINDOWS机器:右击我的电脑,选择管理->共享文件夹->共享在这里面

要有C$这个共享文件夹,(要是没有自己手动加)。
         然后保证在安装LR的机器上使用运行.输入\\被监视机器IP\C$ 然后输入管理员

帐号和密码,如果能看到被监视机器的C盘了,就说明你得到了那台机器的管理员权限,可以

使用LR去连接了。

*说明: LR要连接WINDOWS机器进行监视貌似要有管理员帐号和密码才行。

2 用LR监视windows的步骤
(这里就不详细说明了,只要在窗口中右击鼠标选择Add Measurements就可以了)

 

· 二 linux

1 准备工作
         首先,监视Linux一定要有rstatd这个守护进程,有的Linux版本里也有可能是

rpc.rstatd这里只是名字不同而已,功能是一样的。
         一般来说LINUX需要下载一个包才有这个服务,包名字是rpc.rstatd-

4.0.1.tar.gz. 这是一个源码,需要编译。

下载并安装rstatd

tar -ivh rpc.rstatd-4.0.1.tar.gz
./configure —配置
make —编译
make install —安装
rpc.rstatd —启动rstatd进程

配置rstatd 目标守护进程是xinetd,它的主配置文件是/etc/xinetd.conf 里面内容是

只有基本信息
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
instances = 60
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}

includedir /etc/xinetd.D

· 里面内容的意思在这里就不说了!网上有具体解释,

         我们这里需要修改的是/etc/xinetd.d/下的三个conf文件 rlogin ,rsh,rexec

这三个配置文件,打这三个文件里的disable = yes都改成 disable = no ( disabled 用

在默认的 {} 中 禁止服务)或是把# default: off都设置成 on 这个的意思就是在xinetd

启动的时候默认都启动上面的三个服务!(由于貌似用ps ax不能看到rlogin ,rsh ,rexec

这三个进程是否开启,所以使用default: on,因为rstatd和xinetd这二个服务是否启动在

ps ax里是看的到的)。
         然后你在保证Linux机器上的进程里有rstatd和xinetd这二个服务就可以用LR去

监视了。

几点小的技巧:

检查是否启动: rsh server 监听和TCP 是514。
[root@mg04 root]# netstat -an |grep 514
tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN
如果能看到514在监听说明rsh服务器已经启动。

检查是否启动: rstatd

输入命令: rpcinfo -p

如果能看到

程序 版本 协议 端口

*** **** udp 741 rstatd

那就说明rstatd服务启动了,(当然这里也可以用ps ax代替)。

几点说明:
1) 在实际操作中有可能会碰到一些问题,这里还有一份网上的关于LR连接时候可能出错的

· 情况,详细请见下面;
2) 网上也有人说在LR的资源窗口中右击鼠标出现的Add Measurements选项是暗淡的,我操

作的时候没碰到,这里可能是LR没有完全安装的原因;
3) 由于条件的限制,(没有UNIX环境)所以这次没有遇及UNIX的监控,但网上也有这方面的

资料,说明的也比较清楚,在这里就不再重复了;
4) 由于本人能力有限,只是把网上的内容归纳了一下,说的不对的地方请高人指点,我会更

新内容。

LoadRunner中服务器资源监控器疑难解答
         要监控服务器计算机上的资源,必须能够连接到该计算机。如果监控失败,并

且 LoadRunner 找不到指定的服务器,请确认指定的服务器是否可用。在 Controller 或

优化控制台计算机命令行中键入 ping ,执行“ping”操作。

如何通过LoadRunner监控Linux和Unix操作系统的资源状况
我们在使用LR进行性能测试的时候,经常有需要监控OS的资源使用情况的需求。对于

Windows系统,这个工作进行起来很方便,直接在LR的资源监控窗口中添加需要被监控的

机器名或IP即可,但对于Linux/Unix系统,则要稍微复杂一些,我在这里简单介绍一下如

何在LR中监控Linux/Unix系统的资源使用情况:

  Linux
    对于Linux系统,要想通过LR监控Linux/Unix系统的资源使用情况,需要运行rstatd

服务。如果OS没有安装rstatd(可以查找一下系统中是否存在rpc.rstatd这个文件,如果

· 没有,则说明系统没有安装rstatd),则需要进行安装。rstatd安装步骤如下:
    获得rstatd的安装介质(rstatd.tar.gz)。rstatd可以从redhat的安装CD中获得,

或者从网站上下载(给出一个下载地址,sourceforge的:

)。
    将rstatd.tar.gz拷贝到Linux系统中,解压,赋予可执行权限,进入rpc.rstatd目录

,依次执行如下命令:
      #./configure
      #make
      #make install
    结束后,运行./rpc.rstatd命令,启动服务。这个时候,你就可以在LR中监控Linux

资源了。

Unix

    对于Unix系统,比如Solaris,AIX或者HP UX等,它们的配置过程比较简单——在

inetd.conf(在/etc目录下)文件中去掉rstatd前面的注释,然后启动rstatd服务即可。

原始链接 :http://www.cnitblog.com/qiuyangzh/archive/2006/11/27/19626.html

 

LoadRunner中服务器资源监控器疑难解答

         要监控服务器计算机上的资源,必须能够连接到该计算机。如果监控失败,并

且 LoadRunner 找不到指定的服务器,请确认指定的服务器是否可用。在 Controller 或

优化控制台计算机命令行中键入 ping ,执行“ping”操作。

问题

解决方案

无法监控其他域中的 Windows 计算机,或者“访问被拒绝”。

要获得对远程计算机的管理权限,请在命令提示符下执行以下命令:

%net use \\<计算机名>/用户:[<域>\<远程计算机名>]

提示输入密码时,输入远程计算机的密码。

无法监控 NT/Win 2000 计算机(发出一条错误消息:“未找到计算机名”或“无法连接到主机”)

要监控的 NT/Win 2000 计算机仅允许具有管理员权限的用户进行监控。要允许非管理员用户进行监控,必须授予用户对特定文件和注册表项的读取权限(Microsoft 技术说明编号 Q158438)。需要执行下列步骤:

a. 使用浏览器或文件管理器,授予用户对下列项的读取权限:
%windir%\system32\PERFCxxx.DAT

%windir%\system32\PERFHxxx.DAT

其中 xxx 是系统的基本语言 ID,
例如,英语的 ID 为 009。这些文件可能
已丢失或损坏。如果对此有怀疑,请从
安装 CD 中提取这些文件。

b. 使用 REGEDT32,授予用户对下列项的读取权限:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Perflib
以及该项的所有子项。

c. 使用 REGEDT32,至少授予用户对下列项的读取权限:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Control\SecurePipeServers\winreg

无法从 NT 计算机监控某些 Win 2000 计数器。

在 Win 2000 计算机上运行 Controller 或优化控制台。

某些 Windows 默认计数器生成错误

删除有问题的计数器,并使用“添加度量”对话框添加相应计数器。

无法从被监控的计算机上获得  Server 6.5 版的性能计数器。

这是 SQL Server 6.5 版的一个错误。解决方法为:在被监控的计算机上使用 regedt32,授予用户对以下注册表项的读取权限:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer

(Microsoft 技术说明编号 Q170394)

选定度量未显示在图中。

确保已注册显示文件和 online.exe。要在不执行完全安装的情况下注册监控器的 dll,请运行 LoadRunner\bin 中的 set_mon.bat 批处理文件。

监控 Windows 计算机时,图中不显示任何度量。

检查内置的 Windows 性能监控器。如果该监控器不能正常工作,则可能是通信设置有问题。

监控 UNIX 计算机时,图中不显示任何度量。

确保 rstatd 正在 UNIX 计算机上运行(请参阅“系统资源监控”)。

无法监控下列 Web 服务器之一:MS IIS、MS ASP 或 ColdFusion

请参阅上面的问题“无法监控 Windows 计算机”。

· 

无法监控 WebLogic (JMX) 服务器

打开  根文件夹>\dat\monitors\WebLogicMon.ini 文件,并搜索:
[WebLogicMonitor]
JVM=javaw.exe
将 javaw.exe 更改为java.exe。将打开一个包含跟踪信息的窗口。

·  

·  LoadRunner中添加weblogic监视器(JMX)

· LR8.0+weblogic7.1

· 1。拷贝weblogic安装目录的lib文件夹下的weblogic.jar到LR根目录classer文件夹下;
2。删除该文件夹下的jmxri.jar
3.在LR的dat/monitors下的weblogiMon.ini中JVM的路径和版本,指向当前系统的最新虚拟机,推荐1.4.2。 
在LR8.1和7.8的帮助中关于JVM的路径设置中的文字的最后缺少了一个下引号。算是一个bug;

· 4.在weblogic控制台的安全性的user处新建一个user,name设置为weblogic.admin.mbeam,密码随便设置;
5。将当前用户的group根据需要添加;
6。LR中添加监视器,name写上IP:端口。如192.168.1.127:7001
7.确认后输入之前在console中新建的用户名和密码,确认后就可以打开BEA的监视器选择界面了。

·  

阅读(1404) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~