ping

batch file - getting ip from ping command

∥☆過路亽.° 提交于 2019-12-24 06:49:05
问题 i have this command. ping -n 1 piratelufi.com | find /i "reply from" i want to get the ip inside the ping response. i thought of using %var:~0,10% but i have no idea how to redirect the output to echo. i even tried to use pipe ping -n 1 piratelufi.com | find /i "reply from" | echo %1 but the %1 variable does not represent the output of the first two commands. i even tried to use &1 but i failed. What is the 'variable' needed to echo out the output from the first two commands? 回答1: Check out

Change Color in Command Prompt Based on Result?

倖福魔咒の 提交于 2019-12-24 06:38:03
问题 Bit of a long stretch here. If I want to run a continuous ping command, is it possible to have the output listed in a different color if lets say the result is beyond a certain point? Example: Ping result comes back with 22ms, white Ping result comes back with 300+, red Is that at all possible? Will I need to make a batch file instead? The script listed below works REALLY well. However, I need some additional action with it. When an IP address times out, this script does nothing. It just sits

android - asynctask, progressbar and I/O

心已入冬 提交于 2019-12-24 02:59:11
问题 I'm sorry for posting similar question to my previous one, but I just can't figure this out. I've been using simple "ping" example I found here and just wanted to add ProgressBar but with no luck. I really don't understand what's going on. So, this works fine: protected void onPreExecute() { sb = new StringBuilder(); mPOut = new PipedOutputStream(); try { mPIn = new PipedInputStream(mPOut); mReader = new LineNumberReader(new InputStreamReader(mPIn)); } catch (IOException e) { cancel(true); }

android - asynctask, progressbar and I/O

孤街醉人 提交于 2019-12-24 02:59:03
问题 I'm sorry for posting similar question to my previous one, but I just can't figure this out. I've been using simple "ping" example I found here and just wanted to add ProgressBar but with no luck. I really don't understand what's going on. So, this works fine: protected void onPreExecute() { sb = new StringBuilder(); mPOut = new PipedOutputStream(); try { mPIn = new PipedInputStream(mPOut); mReader = new LineNumberReader(new InputStreamReader(mPIn)); } catch (IOException e) { cancel(true); }

Need to track PC down times using PHP ping and display time down D:HH:MM

自作多情 提交于 2019-12-24 00:15:01
问题 I currently have this code, which runs as a ph that works to let me know if the pc's are pinging: <!DOCTYPE html> <html> <head> <meta http-equiv="refresh" content="30"> </head> <body> <h1>PC Test Ping Status</h1> <?php $host="10.161.10.98"; exec("ping -c 2 " . $host, $output, $result); if ($result == 0) echo "<p>p2 On-Line</p>"; else echo "<p>p2 Off-Line !</p>"; $host="10.161.10.125"; exec("ping -c 2 " . $host, $output, $result); if ($result == 0) echo "<p>p3 On-Line</p>"; else echo "<p>p3

一节课带你学会telnet协议

只谈情不闲聊 提交于 2019-12-23 18:13:55
telnet协议 如果企业网络中有一台或多台网络设备需要远程进行配置和管理,管理员可以使用Telnet远程连接到每一台设备上,对这些网络设备进行集中的管理和维护 Telnet应用场景 Telnet可以通过终端对本地和远程的网络设备进行集中管理 Telnet以客户端/服务器模式运行。Telnet基于TCP协议,服务器端口号默认是23,服务器通过该端口与客户端建立Telnet连接 认证模式 Telnet配置 telnet服务器的配置 [Huawei]interface Ethernet 2/0/0 [Huawei-Ethernet2/0/0]ip address 10.1.1.1 24 [Huawei]user-interface vty 0 4 [Huawei-ui-vty0-4]authentication-mode password [Huawei-ui-vty0-4]set authentication password cipher Enter Password(<8-128>): huawei12 telnet客户端进行连接 <Host>telnet 10.1.1.1 Trying 10.1.1.1 ... Press CTRL+K to abort Connected to 10.1.1.1 ... Login authentication Password: Info:

局域网机器无法上网和网站服务慢问题排查思路

不问归期 提交于 2019-12-23 17:07:11
局域网机器上不了网,怎么排查; a.ping www.baidu.com 如果通,但还是上不了网,可能是浏览器、中毒等问题。 b.ping网关地址。 目的是排查物理链路(网线,网卡,驱动,ip设置等); 如果ping网关不通,则查看ip设置,让后ping自身ip或者ping网内其他机器ip。 如果ping网内其他机器ip通,网关限制不让你上网了。 c.ping网关通的情况i啊,检查dns的设置情况是否正确。 1.检查方法:ping公网ip,看通畅情况(平时记住几个公网ip),ping ip。 2.host、dig、nslookup检查域名解析; d、上网路由器问题(配置和硬件)及isp线路问题。 登陆路由器,检查上级线路,打电话给isp技术。拨号上网的mtu值设置不合理,1480建议值。(出现过) e.辅助排查:其他人能否上网,ip地址冲突,arp病毒,核心交换机坏了,交换机环路(看日志,拔网线试试)。 二,大面积上不了的思路 路由器,isp,核心交换机,arp病毒欺骗网关,网关地址被占用,ldns出问题。核心交换机坏了,交换机环路故障。 问题:检查网站业务是否有问题,网站访问过慢; 1.路是否通; a.ping 域名; ping通,不丢包,服务器问题; ping通,丢包,机房带宽不稳定,各个线路不稳定; ping不通,ping www.baidu.com 机房宕机,服务过载了。

Reachability with Address - Server AND Port - iOS 5

巧了我就是萌 提交于 2019-12-23 15:19:22
问题 I am trying to check whether a server is online or offline: I face the problem that it has a port when connecting to it My code at the moment: struct sockaddr_in address; address.sin_len = sizeof(address); address.sin_family = AF_INET; address.sin_port = htons(25667); address.sin_addr.s_addr = inet_addr("fr7.mooshroom.net"); Reachability *reachability = [Reachability reachabilityWithAddress:&address]; Please let me know what im doing wrong. And please dont link me to other questions, I have

Does Indy ping require UAC elevation?

不羁岁月 提交于 2019-12-23 10:39:57
问题 Does the Indy ICMP component require Administrator privileges to ping? If I run with UAC turned on but without elevated privileges I get an "Access Denied" error message. Looking at this question it sounds like Indy ICMP uses RAW sockets and thus needs elevated privileges? I'm developing using Delphi 2007 & Indy 10.x and testing under Windows 7 Pro. 回答1: My colleague found this Article states that the Indy ICMP component uses RAW Windows sockets, which under Vista or later requires elevated

How to check network bandwidth with Python? [closed]

ぃ、小莉子 提交于 2019-12-23 09:36:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . As asked, I would like my script to check network bandwidth giving me any idea how fast user can surf through web. Is there any library, which allows me to specify size of package to be send and gives ping time or whatever? 回答1: This answer mentions a Python implementation of ping that returns the ICMP packet's