473,554 Members | 3,240 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 15632
"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
2106
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
2243
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...
13
3223
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...
1
6267
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
5573
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...
1
18454
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 ...
2
2082
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...
1
3685
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...
3
2371
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...
0
7583
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...
0
7507
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7783
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8019
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...
1
7542
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...
0
7873
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...
1
5424
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...
0
5143
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...
0
825
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.