By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,729 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,729 IT Pros & Developers. It's quick & easy.

Port Ping?

P: n/a
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
Share this Question
Share on Google+
9 Replies


P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.