Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
Remote site uptime, check for valid url?
Old 02-08-2008, 11:12 AM Remote site uptime, check for valid url?
zig
zig's Avatar
Skilled Talker

Posts: 82
Trades: 0
I'm looking for a script to run off a cron job or just manually that will take in a URL and tell me if the site is up... I'm not sure which function I'm looking for, should I be checking if a file exists, checking the return headers, etc... any help would be appreciated!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
zig is offline
View Public Profile
 
 
Register now for full access!
Old 02-08-2008, 11:22 AM Re: Remote site uptime, check for valid url?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Code:
ping -c1 -w1 192.168.0.1 >&- 2>&- ||echo "unreachable"
If the return if ping is "false" (ie: an error occured), this command will ouptut "unreachable".
Adapt it to your needs.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 02-08-2008 at 11:28 AM..
tripy is offline
View Public Profile Visit tripy's homepage!
 
Old 02-08-2008, 12:01 PM Re: Remote site uptime, check for valid url?
zig
zig's Avatar
Skilled Talker

Posts: 82
Trades: 0
That seems to show it's always down on most sites I tested...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
zig is offline
View Public Profile
 
Old 02-08-2008, 12:04 PM Re: Remote site uptime, check for valid url?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I won't ask you if you have changed the IP adress...
Otherwise, it might be because either your server or the target sites are blocking ping requets (ICMP packets).

In that case, you need to use another tactic. But I have no solution right now in my hat...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
View Public Profile Visit tripy's homepage!
 
Old 02-08-2008, 12:26 PM Re: Remote site uptime, check for valid url?
zig
zig's Avatar
Skilled Talker

Posts: 82
Trades: 0
Yea, I did change the IP...

I somehow did manage to get a cron job stuck which now emails me every minute that my website is down... is it spam when its sent to yourself?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
zig is offline
View Public Profile
 
Closed Thread     « Reply to Remote site uptime, check for valid url?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20747 seconds with 12 queries