473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 15616
"Sven Dzepina" <ma**@styleswitch.de> wrote in message
news:<3f***********************@newsread2.arcor-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.uk> 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**@styleswitch.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.uk> schrieb im Newsbeitrag
news:bn************@ID-175424.news.uni-berlin.de...
Sven Dzepina <ma**@styleswitch.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**@styleswitch.de> schrieb im Newsbeitrag
news:3f***********************@newsread2.arcor-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**@styleswitch.de> schrieb im Newsbeitrag
news:3f***********************@newsread2.arcor-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
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...
3
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...
13
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...
1
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
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...
1
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...
2
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. ...
1
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.