如有10个ip地址。 如何定时去ping他们以确定网络是否正常。同时能返回相应信息,保存日志! 高手请赐教! 不胜感激!
by Iamcainiao - Shell - 2005-08-02 01:21:54 阅读(1589) 回复(3)
例如我用:ping www.sina.com.cn -c1 | grep ping | awk '{ print $3 }' 得到的是:(220.181.30.15) 但是我只需要:220.181.30.15 应该怎么做? 或者还有什么命令可以方便的得到一个域名对应的ip?
visit=2 link=2 download=2 while [ ($visit -eq 2) || ($link -eq 2) || ($link -eq 2) ] do vmstat |tail -1 >> per_test.log done 执行一个包含上述几行语句的shell脚本时,报错 four.sh: line 5: [: missing `]' four.sh: line 5: 2: command not found
各位大虾好,请问在solaris中用csh能不能如下写法:
while read rec
do
if($rec!="") then
echo $rec
fi
done
一、ping程序: 先看: //ping C:\WINNT\system32>ping svr00804 pinging svr00804.sccnj.swirebev.com [192.1.8.12] with 32 bytes of data: Reply from 192.1.8.12: bytes=32 timeICMP回显请求和回显应答报文格式如下:(以ping为例) 类型0或8 代码0 检验和 标识符 序号 结构定义如下: typedef struct icmp_hdr { unsigned char icmp_type; //类型 unsigned char icmp_code; //代码 uns...
同一网卡绑定两个ip,假如是000.00.00.11和000.00.00.22,以前一直正常,前几天000.00.00.22 这个ip被电信暂时封掉,现在又开了,但就是ping不通,000.00.00.11可以ping通。 用ifconfig查看,一切正常,设置没有改动过: ifconfig eth0 Link encap:Ethernet HWaddr 00:50:8B:D3:DF:39 inet addr:200.00.00.11 Bcast:200.00.00.127 Mask:255.255.255.128 …… eth0:0 Link encap:Etherne...
[code] #!/bin/bash while true do read a if [ "$a"="zzz" -o "$a"="ccc" ] then echo yes elif [ "$a"!="zzz" -o "$a"!="ccc" ] then #break or exit fi done [/code] 退不出while