Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('FORCE_FSOCK', true); // False = use ping/ICPM for Port 80, True = always use FSOCK
- $servers = array('Diag.ArenaNetworks.com' => array( '34.235.245.105:80',
- '34.236.133.94:80',
- '34.237.20.65:6112',
- '34.237.20.65:80',
- '34.236.133.94:6112',
- '34.194.154.37:80',
- '34.235.245.105:6112',
- '34.194.154.37:6112',
- '34.225.225.173:6112',
- '34.225.225.173:80' ),
- 'assetcdn.101.ArenaNetworks.com' => array( '13.35.253.92:80',
- '13.35.253.148:80',
- '13.35.253.177:80',
- '13.35.253.214:80' ),
- 'auth1.101.ArenaNetworks.com' => array( '34.237.20.65:6112',
- '34.236.133.94:6112',
- '34.194.154.37:6112',
- '34.235.245.105:6112',
- '34.225.225.173:6112' ),
- 'auth2.101.ArenaNetworks.com' => array( '35.158.82.209:6112',
- '35.157.208.241:6112',
- '18.194.203.41:6112',
- '35.158.175.20:6112',
- '52.59.151.62:6112' ),
- 'cligate.101.NCPlatform.net' => array( '18.184.132.250:6112',
- '18.194.9.177:6112',
- '35.157.77.102:6112',
- '3.121.82.222:6112',
- '18.184.118.144:6112',
- '18.185.197.21:6112',
- '18.197.66.19:6112' ) );
- foreach ($servers as $group=>$ips) {
- echo "\n".'Checking ('.$group.')'."\n\n";
- foreach ($ips as $ip) {
- $atoms = explode(':', $ip);
- if (count($atoms) == 2) {
- $ip = $atoms[0];
- $port = $atoms[1];
- } else {
- $ip = $atoms[0];
- $port = 80;
- }
- echo "\t".'Testing ('.$ip.') ';
- if ((FORCE_FSOCK) || ($port <> 80)) {
- if (!$socket = @fsockopen($ip, $port, $errno, $errstr, 30)) {
- echo '-=> offline [#'.$errno.': '.$errstr."]\n";
- } else {
- echo "-=> online\n";
- fclose($socket);
- }
- } else {
- $str = exec("ping -n 1 -w 1 ".$ip, $input, $result);
- if ((int)$result == 0) {
- echo "-=> Online!\n";
- } else {
- echo "-=> Offline!\n";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement