linux 开启rsh权限,开启rsh服务

2011-11-28 13:03

朋友你好!

我刚开始搞linux,碰到了很多问题,想问你下,希望能帮我解答下。

下面是我的一段shell 程序

#!/bin/sh

while [ 0 ]

do

read score

if [ $score -lt 60 ];then

echo " you must work hard!"

elif [ $score -lt 80 ]

echo " just so so,you should do better"

elif [ $score -le 100 ]

echo ”done well ,keep it "

fi

echo " if you want to contiune press y,else press any key to exit"

read C

if [ $c =y ];then

contiune

else

echo "thanks for coming"

fi

done

运行

$ sh -x test.sh

有个错误提示在第二个if出(if 【 $C =y ]) unary operator expected

是什么原因呀?

我以为是一个shell程序里不能同时出现两个if--then--else语句,可要是不能这样

我要实现程序跳转(也就是查了以个分数等级后,不退出程序还能继续查询第二个)

该用什么方法实现。

小弟在此先行叩谢了。

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服务的状态 如果未出现上图的rstatd说明没有安装成功,需要重复以上步骤。 到这里为止,LR监控Linux必要的服务都已安装好了。 五、关闭防火墙 [root@localhost /]# service iptables stop 六、利用LR中的Controller监控Linux资源 在Controller中,将System Resource Graphs中的Unix resources拖到右侧的资源监控区域。 鼠标右键选择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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值