ping

How to check if a web service is up and running without using ping?

China☆狼群 提交于 2019-12-18 13:09:52
问题 How can i check if a method in a web service is working fine or not ? I cannot use ping. I still want to check any kind of method being invoked from the web service by the client. I know it is difficult to generalize but there should be some way. 回答1: I use this method and it works fine : public bool IsAddressAvailable(string address) { try { System.Net.WebClient client = new WebClient(); client.DownloadData(address); return true; } catch { return false; } } 回答2: The only way to know if a web

Creating a ping uptime service with PHP

冷暖自知 提交于 2019-12-18 12:28:40
问题 This question was migrated from Webmasters Stack Exchange because it can be answered on Stack Overflow. Migrated 8 years ago . I have a server that I can use PHP on and a router that can be pinged from the Internet. I want to write a PHP script that sends a ping to the router every 5 minutes with the following results: If the ping succeeds, then nothing would happen. If the ping fails, then it waits a few minutes, and if it still fails it sends a warning to my e-mail address once. After the

I want to get the ping execution time and result in string after ping host

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 07:15:23
问题 I want to get the ping execution time and result in string after ping host. How can I do it? 回答1: long currentTime = System.currentTimeMillis(); boolean isPinged = InetAddress.getByName(servername).isReachable(2000); // 2 seconds currentTime = System.currentTimeMillis() - currentTime; if(isPinged) { System.out.println("pinged successfully in "+ currentTime+ "millisecond"); } else { System.out.println("PIng failed."); } But this will use ICMP ping only in windows system. 回答2: did you check

Powershell - Test-Connection failed due to lack of resources

纵然是瞬间 提交于 2019-12-18 05:38:07
问题 Test-connection intermittently fails with a lack of resources error: test-connection : Testing connection to computer 'SOMESERVER' failed: Error due to lack of resources At line:1 char:45 + ... ($server in $ServersNonProd.Name) { test-connection $server -Count 1} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (SOMESERVER:String) [Test-Connection], PingException + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand As a

Powershell - Test-Connection failed due to lack of resources

亡梦爱人 提交于 2019-12-18 05:37:21
问题 Test-connection intermittently fails with a lack of resources error: test-connection : Testing connection to computer 'SOMESERVER' failed: Error due to lack of resources At line:1 char:45 + ... ($server in $ServersNonProd.Name) { test-connection $server -Count 1} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (SOMESERVER:String) [Test-Connection], PingException + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand As a

Pinging an IP range with Scapy

邮差的信 提交于 2019-12-18 04:52:40
问题 I'm attempting to write a Python script which uses the Scapy module to ping an internal IP range to determine which IP's are online. I've got this so far: #!/usr/bin/python from scapy.all import * conf.verb = 0 for ip in range(0, 256): packet = IP(dst="192.168.0." + str(ip), ttl=20)/ICMP() reply = sr1(packet) if "192.168." in reply.src: print reply.src, "is online" And the program will sit for a while doing nothing, and then if I kill it with CTRL+C I get an error message: Traceback (most

How to ping faster when I reach unreachable IP?

邮差的信 提交于 2019-12-18 04:12:43
问题 I have an app which pings IP or IP range. The problem is that when hosts are closed it takes longer to ping than they are open. When host is closed the time to ping is about 1-2 seconds. How could I make it faster when hosts are closed? This is my code: using System; using System.Text; using System.Windows.Forms; using System.Net.NetworkInformation; namespace Range_Pinger { public partial class PingIPRange : Form { uint startIP, endIP, currentIP; int count = 0; int open = 0; int closed = 0;

Ping工具

拟墨画扇 提交于 2019-12-18 01:45:41
本次升级在上一版本的基础上将网络Ping检测划分为按预设的分组Ping和用户自定义的Ping。 添加了网络丢包测试的功能,更新了分组设备管理的UI。 config.ini文件中存储的信息为VNC软件的登录密码,软件实现了VNC软件登录时密码的自动填充,不需要再手动输入. devicetype.ini文件中存储着设备的类型。 以下附上软件截图和下载地址: Ping2.0主窗口: Ping2.0分组Ping: Ping2.0自定义Ping: Ping2.0设备分组管理: 下载地址: http://files.cnblogs.com/happycode_k/Ping-20140422.rar 来源: https://www.cnblogs.com/happycode_k/archive/2012/09/01/2666552.html

Docker - Ubuntu - bash: ping: command not found

半城伤御伤魂 提交于 2019-12-17 21:27:12
问题 I've got a Docker container running Ubuntu which I did as follows: docker run -it ubuntu /bin/bash however it doesn't seem to have ping . E.g. bash: ping: command not found Do I need to install that? Seems a pretty basic command to be missing. I tried whereis ping which doesn't report anything. 回答1: Docker images are pretty minimal, But you can install ping in your official ubuntu docker image via: apt-get update apt-get install iputils-ping Chances are you dont need ping your image, and just

ping for indefinite amount of time and get its output in Python

荒凉一梦 提交于 2019-12-17 21:17:34
问题 The task is: Try to send ping in python using the most basic form like "ping 8.8.8.8". After some time terminate the ping command (In a terminal, one will do Ctrl+C) and get its output. The last several lines of output which shows the ping statistics are of particular interest. Two methods tried, did not work. My OS version is Mac OS X 10.10.1. First method uses module pexpect, and ping will stop after about 17 seconds though I did not ask it to stop: import pexpect import time child =