51Testing软件测试论坛

标题: 对linux系统的服务器监控 [打印本页]

作者: han_xue1230    时间: 2007-5-14 08:51
标题: 对linux系统的服务器监控
对linux系统的mysql数据库服务器监控,
首先是对系统的监控,
在服务器上安装rstatd守护进程
安装步骤:
1. 从网上下载rstatd
2. 将该文件放到/home/user目录下
3. chmod 777 rpc.rstatd----改变该文件读写的权限,拥有所有权限。
4. chmod 777 configure ---同上
5. ./configure ---配置
6. make ---编译
7. make install ---安装
8. rpc.rstatd ---启动rstatd进程
以上的步骤技术已经在服务器上操作了,
在lr中配置
从LR里面add measurement, 填写linux机器的IP,出现所有unix/linux的计数器,包括cpu的,mem的,disk,network的。介绍几个常用的:
average load :在过去的1分钟,的平均负载
cpu utilization: cpu的使用率
disk traffic: disk传输率
paging rate: 每秒从磁盘读到物理内存,或者从物理内存写到页面文件的内存页数
Swap-in rate: 每秒交换到内存的进程数
Swap-out rate: 每秒从内存交换出来的进程
这里,从LR里面add measurement, 填写linux机器的IP,出现所有unix/linux的计数器,添加了linux机器的IP,但没有出现linux的计数器
下面是我添加linux的计数器的步骤:
作者: han_xue1230    时间: 2007-5-14 08:53
不知道问题出在哪里
作者: han_xue1230    时间: 2007-5-14 08:58
我成功添加了ScreenShot010.jpg 中所有的计数器,出现了下面的错误
Monitor name :UNIX Resources. Cannot initialize the monitoring on 192.168.0.8. 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.
RPC-TCP: RPC Server <100001, 3, 17> is not registered on host '192.168.0.8'. (entry point: CFactory::Initialize).        [MsgId: MMSG-47190]
作者: shanxi    时间: 2007-5-14 09:06
There is no need for any LoadRunner installation to be on a Unix/Linux Machine to be monitored. However, the machine must have the default RSTAT daemon installed and running. The controller establishes a UDP socket connection with the UNIX machine. It first communicates with port 111 on the Unix machine and this port is then mapped to the dynamic port on which the rstatd is working. The controller then queries rstatd and all communication takes place through this established UDP socket connection.

To monitor a UNIX/Linux machine through a firewall, you must run a UNIX utility called rpcinfo and identify the rstatd's port number. By running rpcinfo -p <hostname>, you will receive a list of all RPC servers registered in the host?s portmapper, along with the port number. This list will not change until rstatd is stopped and rerun.

Some firewalls allow you to open an RPC program number instead of a port. In such cases, open program 100001. If are prompted to include a version number, specify versions 3 and 4.

Note: You can use the same 'UNIX Resources monitor' to monitor Linux machine



http://bbs.51testing.com/viewthr ... hlight=%BC%E0%CA%D3

[ 本帖最后由 shanxi 于 2007-5-14 09:09 编辑 ]
作者: han_xue1230    时间: 2007-5-14 09:12
前辈有没有中文的解释啊
作者: han_xue1230    时间: 2007-5-14 09:37
为什么在platform中没有出现linux难道是用unix代替吗
作者: Zee    时间: 2007-5-14 09:58
是。
作者: han_xue1230    时间: 2007-5-14 10:10
我用unix代替了,新的问题又出现了
Monitor name :UNIX Resources. Cannot initialize the monitoring on 192.168.0.8. 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.
RPC-TCP: RPC Server <100001, 3, 17> is not registered on host '192.168.0.8'. (entry point: CFactory::Initialize).        [MsgId: MMSG-47190]
技术说已经启动RPC了
作者: feiyuw    时间: 2007-5-14 10:51
怀疑是iptables的问题,试着关闭iptables看看,另外linux下资源监控可以用linux系统下的sar工具来实现,感觉得到的数据比较全面
作者: han_xue1230    时间: 2007-5-14 11:06
还是不行啊
作者: han_xue1230    时间: 2007-5-14 11:58
请高人指点啊sdlkfj9
作者: Zee    时间: 2007-5-14 12:12
防火墙的问题。
作者: han_xue1230    时间: 2007-5-14 14:21
防火墙早就关掉了啊,问题仍然存在
作者: shanxi    时间: 2007-5-14 15:31
linux系统下的SAR真的很强大

不过楼主想要的是在Controller端看到服务器的资源占用情况
作者: han_xue1230    时间: 2007-5-14 15:44
对啊,但现在报出上面的错误了,不知道问题出现在哪里,RPC也已经开启了
[root@localhostè&reg;&reg;   &ccedil;&laquo;&macr;&aring;&pound;o -p
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  32772  status
    100024    1   tcp  32811  status
    100005    1   udp    835  mountd
    100005    1   tcp    838  mountd
    100005    2   udp    835  mountd
    100005    2   tcp    838  mountd
    100005    3   udp    835  mountd
    100005    3   tcp    838  mountd
作者: han_xue1230    时间: 2007-5-14 15:45
原帖由 shanxi 于 2007-5-14 15:31 发表
linux系统下的SAR真的很强大

不过楼主想要的是在Controller端看到服务器的资源占用情况

请您帮我看看到底是怎么回事,防火墙早就关掉了啊
作者: han_xue1230    时间: 2007-5-15 14:15
rstatd是系统自带的,防火墙也已经关掉了,但还是连接不上RPC
作者: duola1119    时间: 2007-5-15 16:38
1.安装rsh,和rsh-server两个服务包。
a.    卸载rsh
rpm –q rsh----------查看版本号
rpm  -e 版本号---------卸载该版本。
B.安装

rpm –ivh  rsh-0.17-14.i386.rpm  rsh-server-0.17-14.i386.rpm
这两个包在我的目录下有共享。

2. 下载并安装rstatd(这个包在我的共享目录下也有)
gunzip rpc.rstatd-4.0.1.tar.gz  

Tar –cvf rpc.rstatd-4.0.1.tar.
./configure ---配置
make ---编译
make install ---安装
rpc.rstatd ---启动rstatd进程

3。 打开/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

4.重启xinetd:

A:
service xinetd reload

B:
/sbin/service xinetd rstart
5。修改/etc/xinetd.d/下的三个conf文件  rlogin ,rsh,rexec 这三个配置文件,
打这三个文件,将里面的disable = yes都改成 disable = no     ( disabled 用在默认的 {} 中 禁止服务)
或是把# default: off都设置成 on  ,并把“#”去掉,这个的意思就是在xinetd启动的时候默认都启动上面的三个服务!

6.启动rstatd:

rpc.rstatd

7.查看rstatd是否启动:

rpcinfo –p

如果能看到:   

       100001    5   udp    618  rstatd

    100001    3   udp    618  rstatd

    100001    2   udp    618  rstatd

    100001    1   udp    618  rstatd

就说明rstatd服务已经启动。可以用LR去监视了。

因为无法上传到rsh-0.17-14.i386.rpm  rsh-server-0.17-14.i386.rpm这两个文件,所以请大家在linux光盘里找,或是在网上找啦.

HP UNIX

手动停sendmail& snmp:

/sbin/init.d/sendmail stop

/sbin/init.d/SnmpMaster stop



假如在启动时就不要启动sendmail,修改/etc/rc.config.d/mailservs, 把 =1 改为 =0

假如在启动时就不要启动snmp,修改 /etc/rc.config.d/SnmpMaster, 把 =1 改为 =0

停rstatd服务:先可用rpcinfo查看,若有,/etc/inetd.conf 文件里注释掉 rstat。

                   并执行 #/sbin/init.d/inetd 来重启inetd服务
作者: han_xue1230    时间: 2007-5-15 17:25
服务器上已经有了
作者: han_xue1230    时间: 2007-5-15 17:26
而且端口也已经打开了
作者: zilter    时间: 2007-5-23 13:10
标题: 回复 的帖子
看不懂
作者: 21世纪恐龙    时间: 2007-5-30 11:59
问题解决了,是rstatd没有启动,在启动rstatd之前,要先启动xinetd
作者: fwind1    时间: 2009-5-13 20:45
学习一下




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2