51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 6027|回复: 22
打印 上一主题 下一主题

[原创] 对linux系统的服务器监控

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2007-5-14 08:51:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
对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的计数器的步骤:
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2007-5-14 08:53:11 | 只看该作者
不知道问题出在哪里

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2007-5-14 08:58:53 | 只看该作者
我成功添加了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]
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2007-5-14 09:06:30 | 只看该作者
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 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2007-5-14 09:12:19 | 只看该作者
前辈有没有中文的解释啊
回复 支持 反对

使用道具 举报

该用户从未签到

6#
 楼主| 发表于 2007-5-14 09:37:47 | 只看该作者
为什么在platform中没有出现linux难道是用unix代替吗
回复 支持 反对

使用道具 举报

该用户从未签到

7#
发表于 2007-5-14 09:58:47 | 只看该作者
是。
回复 支持 反对

使用道具 举报

该用户从未签到

8#
 楼主| 发表于 2007-5-14 10:10:53 | 只看该作者
我用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了
回复 支持 反对

使用道具 举报

该用户从未签到

9#
发表于 2007-5-14 10:51:01 | 只看该作者
怀疑是iptables的问题,试着关闭iptables看看,另外linux下资源监控可以用linux系统下的sar工具来实现,感觉得到的数据比较全面
回复 支持 反对

使用道具 举报

该用户从未签到

10#
 楼主| 发表于 2007-5-14 11:06:09 | 只看该作者
还是不行啊
回复 支持 反对

使用道具 举报

该用户从未签到

11#
 楼主| 发表于 2007-5-14 11:58:03 | 只看该作者
请高人指点啊sdlkfj9
回复 支持 反对

使用道具 举报

该用户从未签到

12#
发表于 2007-5-14 12:12:57 | 只看该作者
防火墙的问题。
回复 支持 反对

使用道具 举报

该用户从未签到

13#
 楼主| 发表于 2007-5-14 14:21:11 | 只看该作者
防火墙早就关掉了啊,问题仍然存在
回复 支持 反对

使用道具 举报

该用户从未签到

14#
发表于 2007-5-14 15:31:45 | 只看该作者
linux系统下的SAR真的很强大

不过楼主想要的是在Controller端看到服务器的资源占用情况
回复 支持 反对

使用道具 举报

该用户从未签到

15#
 楼主| 发表于 2007-5-14 15:44:26 | 只看该作者
对啊,但现在报出上面的错误了,不知道问题出现在哪里,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
回复 支持 反对

使用道具 举报

该用户从未签到

16#
 楼主| 发表于 2007-5-14 15:45:08 | 只看该作者
原帖由 shanxi 于 2007-5-14 15:31 发表
linux系统下的SAR真的很强大

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

请您帮我看看到底是怎么回事,防火墙早就关掉了啊
回复 支持 反对

使用道具 举报

该用户从未签到

17#
 楼主| 发表于 2007-5-15 14:15:12 | 只看该作者
rstatd是系统自带的,防火墙也已经关掉了,但还是连接不上RPC
回复 支持 反对

使用道具 举报

该用户从未签到

18#
发表于 2007-5-15 16:38:08 | 只看该作者
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服务
回复 支持 反对

使用道具 举报

该用户从未签到

19#
 楼主| 发表于 2007-5-15 17:25:47 | 只看该作者
服务器上已经有了
回复 支持 反对

使用道具 举报

该用户从未签到

20#
 楼主| 发表于 2007-5-15 17:26:09 | 只看该作者
而且端口也已经打开了
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-27 09:28 , Processed in 0.090271 second(s), 29 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表