473,908 Members | 3,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Port Ping?

Hello people,

I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.

But how I can realize that?

Gretting from Germany.
Jul 17 '05 #1
9 15667
"Sven Dzepina" <ma**@styleswit ch.de> wrote in message
news:<3f******* *************** *@newsread2.arc or-online.net>...

I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.


if ($exit_code = system ('ping www.styleswitch .de', $output)) {
// analyze the $output array
} else {
echo 'Ping failed. ';
}

Cheers,
NC
Jul 17 '05 #2
That ping command will go on forever under Linux.
You need to specify ping -cX where X equals the number of times you want
to ping the remote host.

Jul 17 '05 #3
Hello,

but how I can read out the data?
I want to work with the results from the linux "ping"-command.
Can I get only the average from the ping.

Thanks!

"Dave Bell" <dr**@kent.ac.u k> schrieb im Newsbeitrag
news:bn******** *@athena.ukc.ac .uk...
That ping command will go on forever under Linux.
You need to specify ping -cX where X equals the number of times you want
to ping the remote host.

Jul 17 '05 #4
Sven Dzepina <ma**@styleswit ch.de> wrote:
but how I can read out the data?
I want to work with the results from the linux "ping"-command.
Can I get only the average from the ping.


How about having a look in the manual?

http://uk.php.net/manual/en/ref.exec.php

JOn
Jul 17 '05 #5
Sven Dzepina wrote:
Hello people,

I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.

But how I can realize that?

Gretting from Germany.


try using hping2 with system()

--
WM
(del #NOSPAM# to answer)

Posted from X-Privat Free NNTP server - www.x-privat.org
Jul 17 '05 #6
Hi,

yes! But I did not find anything right about ping command.
exec("ping test.com:29"); This is not possible ??? =(
"Jon Kraft" <jo*@jonux.co.u k> schrieb im Newsbeitrag
news:bn******** ****@ID-175424.news.uni-berlin.de...
Sven Dzepina <ma**@styleswit ch.de> wrote:
but how I can read out the data?
I want to work with the results from the linux "ping"-command.
Can I get only the average from the ping.


How about having a look in the manual?

http://uk.php.net/manual/en/ref.exec.php

JOn

Jul 17 '05 #7
hping2 is not possible =(

"William Maddler" <ma************ *@cryptorebels. net> schrieb im Newsbeitrag
news:3f******@x-privat.org...
Sven Dzepina wrote:
Hello people,

I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.

But how I can realize that?

Gretting from Germany.


try using hping2 with system()

--
WM
(del #NOSPAM# to answer)

Posted from X-Privat Free NNTP server - www.x-privat.org

Jul 17 '05 #8
Please,

I need further informations...
"Sven Dzepina" <ma**@styleswit ch.de> schrieb im Newsbeitrag
news:3f******** *************** @newsread2.arco r-online.net...
Hello people,

I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.

But how I can realize that?

Gretting from Germany.

Jul 17 '05 #9
Carved in mystic runes upon the very living rock, the last words of Sven
Dzepina of comp.lang.php make plain:
"Sven Dzepina" <ma**@styleswit ch.de> schrieb im Newsbeitrag
news:3f******** *************** @newsread2.arco r-online.net...
Hello people,

I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.

But how I can realize that?

Please,

I need further informations...


First of all, don't top post.

Second, you not only have to read the manual, you have to understand it.
Of course it doesn't say anything about ping - it's the manual entry for
the exec() function, und es sagt:

"Ist der Parameter /array/ angegeben, wird dieses mit jeder Zeile des
Befehlsausgabe gefüllt."

http://www.php.net/manual/de/function.exec.php

Read it and understand it. That should get you going.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2131
by: David | last post by:
hi i try to connect to my site on port 80 from my local network no probleme but from outside is do not work like no site a this address ! my firewall is redirect port 80 on my local IP (the config sopose to be ok) i can ping my IP i already try on some other port
3
2272
by: Jason Rodman | last post by:
I have downloaded every example on how to create a ping utility in .Net in both VB and C#, but have been disappointed with the results. I have YET to find an example that returns consistent results that are even close the the actual ping command line utility. For example: If i would ping the same server over and over, some pings would come back in 0 milliseconds, others would come back in 15, but never in between. It would always jump...
13
3252
by: Adam | last post by:
Hi! I'm trying to write a small application for an online gaming site (flight sims), where people can add their local server to a list. Basically, I just need to be able to loop/ping each respective server - via a specific port (2934 or 2935) to see whether the server is still "live", so the hosters don't have to manually update their status on the site. Everything I've seen seems overly complex. Efforts so far have returned info via...
1
6339
by: Marty Cruise | last post by:
I understand how easy it is to use the my.computer.network.ping command, but is it as easy to check for a response on a given port? How can I check for a response for port x at 123.456.789?
5
5599
by: Deepak | last post by:
I am programing a ping application which pings various centers . I used timer loop and it pings one by one. Now when i finish pinging one center it should wait for the ping_completed function to be executed and then continue pinging another certer. The ping_completed function is called on completion of ping by the os and i have no control on it .
1
18540
by: Krish | last post by:
All, I have an offline application that works online for some data syncronization. For data syncronization I access a webservice. I want to show whether my application is online or not by checking whether the application is able to access the webservice. If the webservice is accessible, the application is online. otherwise it is offline What is the best way to ping a url in C# ?
2
2093
by: Jason | last post by:
Hello I'm about ready to attempt writting a simple TCP server in C# in which all I need to do is send out some data to a particular IP and port, and the end device will send it back to me. Almost like a ping, you could say. All I need to do is a compare what I get back to what was sent, to make the end unit is still alive. So I've got an IP address of the end device and a port number. 192.168.1.2 5281 Can someone explain to me the...
1
3699
by: Andy Bates | last post by:
Hi - Can't see another newsgroup to post this in; so thought I'd post here. I have a C# application that relies on multicast UDP to detect how many PCs the application is executing on concurrently. This works okay providing the port is open but fails miserably if the port is blocked by a firewall. All applications provide a server listening on the port for the ping but for some reason on the PC sending the ping irrespective of...
3
2394
dlite922
by: dlite922 | last post by:
I have a proprietary software on two different internal networks. on one the client-side software can access the server, and the second network, they can't. I have no real clue which ports are needed, 1. What's the best way to find out? will telnet x.x.x.x port# work? 2. Does one side (server) have to be listening on a port to be able to detect that it is open? If it doesn't listen, than requests end up no where. right? 3. For...
0
10029
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10911
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11033
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10529
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9719
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8092
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7240
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6131
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.