110mb.com Forum
News: Currently none. But refer to this news before you post an error, maybe it's already being fixed Wink
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2008, 01:30:28 AM


Login with username, password and session length


Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: Can you add this script?  (Read 524 times)
dstemp
Active Member
**
Offline Offline

Posts: 89



WWW
« on: August 15, 2008, 06:53:49 PM »

Code:
<?php


function routerDetect() {
$server = "0.0.0.0"; // Enter your IP address or website address.
$port = "80"; // Use port 80 if the $server variable has something running there.
$host = "Whatever"; // Call it what ever you want. It doesn't really matter.

preg_match("/^(http:\/\/)?([^\/]+)/i", "$server", $match);
$host = $match[2];
preg_match_all("/\.([^\.\/]+)/",$host, $match);

$matches[0][0] = $matches[1][0];
$host = trim($host);

$socket = "";
@
$socket = fsockopen("$host", $port, $errno, $errstr, 2);
if(!
$socket) {
$socket = header("Location: http://example.com/offline.png"); // Location of offline image goes here.
} else {
fclose($socket);
$socket = header("Location: http://example.com/online.png"); // Location of online image goes here.
}
}

routerDetect();
readfile($socket);

?>
(c) TeenDev 200? from GBAtemp.net

This woul;d be a useful feature on the page to tell you if 1. YOUR website is on (if logged in) and also
to tell people which box's are online.
If you do use it, please give credit to TeenDev
Logged
pestaa
[HUN] Operálandusz
Hyper-Active Member
***
Offline Offline

Posts: 184


What Google doesn't know, it doesn't exist at all.


WWW
« Reply #1 on: August 15, 2008, 07:19:26 PM »

Nice script, but here are my two cents.
  • This would only work on accounts where fsockopen enabled.
  • It doesn't really matter, whether boxes are online or not. What does matter, if your site is reachable or out of order.
  • If any box is down temporarily, forum news (in the header) will represent the current status.
Logged

szerepjáték -- hungarian forum-based rpg.
Keep your eyes open, I'm a hungarian teenager; nobody knows, which language mistake can solve the world's biggest problems. cheesy
"For your convenience we offer courteous and efficient self-service."
dstemp
Active Member
**
Offline Offline

Posts: 89



WWW
« Reply #2 on: August 15, 2008, 07:41:00 PM »

True... maybe an option for users to add it?
Logged
pestaa
[HUN] Operálandusz
Hyper-Active Member
***
Offline Offline

Posts: 184


What Google doesn't know, it doesn't exist at all.


WWW
« Reply #3 on: August 15, 2008, 10:13:41 PM »

Nah, I would recommend to iterate this script and install it to 110mb.info to eventually obtain uptime information about all the boxes including www server.
Logged

szerepjáték -- hungarian forum-based rpg.
Keep your eyes open, I'm a hungarian teenager; nobody knows, which language mistake can solve the world's biggest problems. cheesy
"For your convenience we offer courteous and efficient self-service."
general vegitable
ⓖⓔⓝⓔⓡⓐⓛ ⓥⓔⓖⓘⓣⓐⓑⓛⓔ
Loyal 110MB Member
*******
Offline Offline

Posts: 3535


please ask (by pm duh!) before you yim me


WWW
« Reply #4 on: August 16, 2008, 03:55:25 AM »

or for an uptime script use this
Logged



woot, i have a 110mb status system see => http://general-vegitable.110mb.com/110status
pestaa
[HUN] Operálandusz
Hyper-Active Member
***
Offline Offline

Posts: 184


What Google doesn't know, it doesn't exist at all.


WWW
« Reply #5 on: August 16, 2008, 05:42:57 PM »

Dexter's site is just great, but will became pointless if his box is get down. These stats should be located externally, like 110mb.info, as I mentioned above.
Logged

szerepjáték -- hungarian forum-based rpg.
Keep your eyes open, I'm a hungarian teenager; nobody knows, which language mistake can solve the world's biggest problems. cheesy
"For your convenience we offer courteous and efficient self-service."
general vegitable
ⓖⓔⓝⓔⓡⓐⓛ ⓥⓔⓖⓘⓣⓐⓑⓛⓔ
Loyal 110MB Member
*******
Offline Offline

Posts: 3535


please ask (by pm duh!) before you yim me


WWW
« Reply #6 on: August 16, 2008, 06:18:43 PM »

an external one => http://110ss.lesley.uni.cc
Logged



woot, i have a 110mb status system see => http://general-vegitable.110mb.com/110status
aldo
#3 Top Poster! :D
Official 110mb Guru
********
Offline Offline

Posts: 7587


SMF is ftw :D


WWW
« Reply #7 on: August 16, 2008, 06:19:02 PM »

My 110MB Server Status Script (refer to signature) isn't hosted here, so that would be accessible if all servers were down, though you don't need a status script to tell you that though do you? Lol...
Logged

Firefox = Not Standards Compliant
Windows is not bloated, users make it that way because of how much software is available. How can you bloat an OS that has little for it? (Linux)


Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

  Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC

Theme by Dilber MC | Using SEO4SMF Mod

All content on this forum (especially posts) is copyright property of 110mb & the member
who wrote the post. So if you wish to steal anyone's post on this forum, you'll wish you
were dead because our lawyers will sue your ass!