Advertisement
Guest User

EMS Server

a guest
Dec 23rd, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.54 KB | None | 0 0
  1. <?php
  2.  
  3. function check($server,$port=8585,$timeout=3) {
  4. $PingIT = fsockopen($server, $port, $timeout);
  5. if ( ! $PingIT ) {
  6. return FALSE;
  7. } else {
  8. return TRUE; }}
  9.  
  10. //IP:t till servrarna
  11.  
  12. $server50 = '109.234.77.11';
  13. $status50 = check($server50);
  14.  
  15. $server = '109.234.77.20';
  16. $status = check($server);
  17. $server2 = '109.234.77.21';
  18. $status2 = check($server2);
  19. $server3 = '109.234.77.21';
  20. $status3 = check($server3);
  21. $server4 = '109.234.77.22';
  22. $status4 = check($server4);
  23. $server5 = '109.234.77.22';
  24. $status5 = check($server5);
  25. $server6 = '109.234.77.23';
  26. $status6 = check($server6);
  27. $server7 = '109.234.77.23';
  28. $status7 = check($server7);
  29. $server8 = '109.234.77.24';
  30. $status8 = check($server8);
  31. $server9 = '109.234.77.24';
  32. $status9 = check($server9);
  33. $server10 = '109.234.77.25';
  34. $status10 = check($server10);
  35. $server11 = '109.234.77.25';
  36. $status11 = check($server11);
  37. $server12 = '109.234.77.26';
  38. $status12 = check($server12);
  39. $server13 = '109.234.77.26';
  40. $status13 = check($server13);
  41. $server14 = '109.234.77.26';
  42. $status14 = check($server14);
  43.  
  44. //Kollar om login page är igång
  45. if( $status50 ) {
  46. $Result50 = "<font color='green'><b>online</b></font>";
  47. } else {
  48. $Result50 = "<font color='red'><b>offline</b></font>";}
  49. //Kollar pingtiden
  50. $porten50 = "8484";
  51. $timeouten = "3";
  52. function ping50($server50, $porten50, $timeouten) {  
  53.   $tB = microtime(true);  
  54.   $fP = fSockOpen($server50, $porten50, $errno, $errstr, $timeouten);  
  55.   if (!$fP) { return "down"; }  
  56.   $tA = microtime(true);  
  57.   return round((($tA - $tB) * 1000), 0)."ms";  
  58. }
  59.  
  60.  
  61.  
  62. //Kollar om servern 1 är igång
  63. if( $status ) {
  64. $Result1 = "<font color='green'><b>online</b></font>";
  65. } else {
  66. $Result1 = "<font color='red'><b>offline</b></font>";}
  67. //Kollar pingtiden
  68. $porten = "8085";
  69. $timeouten = "3";
  70. function ping1($server, $porten, $timeouten) {  
  71.   $tB = microtime(true);  
  72.   $fP = fSockOpen($server, $porten, $errno, $errstr, $timeouten);  
  73.   if (!$fP) { return "down"; }  
  74.   $tA = microtime(true);  
  75.   return round((($tA - $tB) * 1000), 0)."ms";  
  76. }
  77. //Kollar om servern 2 är igång
  78. if( $status2 ) {
  79. $Result2 = "<font color='green'><b>online</b></font>";
  80. } else {
  81. $Result2 = "<font color='red'><b>offline</b></font>";}
  82. //Kollar pingtiden
  83. $porten = "8085";
  84. $timeouten = "3";
  85. function ping2($server2, $porten, $timeouten) {  
  86.   $tB = microtime(true);  
  87.   $fP = fSockOpen($server2, $porten, $errno, $errstr, $timeouten);  
  88.   if (!$fP) { return "down"; }  
  89.   $tA = microtime(true);  
  90.   return round((($tA - $tB) * 1000), 0)."ms";  
  91. }
  92. //Kollar om servern 3 är igång
  93. if( $status3 ) {
  94. $Result3 = "<font color='green'><b>online</b></font>";
  95. } else {
  96. $Result3 = "<font color='red'><b>offline</b></font>";}
  97. //Kollar pingtiden
  98. $porten2 = "8086";
  99. $timeouten = "3";
  100. function ping3($server3, $porten2, $timeouten) {  
  101.   $tB = microtime(true);  
  102.   $fP = fSockOpen($server3, $porten2, $errno, $errstr, $timeouten);  
  103.   if (!$fP) { return "down"; }  
  104.   $tA = microtime(true);  
  105.   return round((($tA - $tB) * 1000), 0)."ms";  
  106. }
  107. //Kollar om servern 4 är igång
  108. if( $status4 ) {
  109. $Result4 = "<font color='green'><b>online</b></font>";
  110. } else {
  111. $Result4 = "<font color='red'><b>offline</b></font>";}
  112. //Kollar pingtiden
  113. $porten = "8085";
  114. $timeouten = "3";
  115. function ping4($server4, $porten, $timeouten) {  
  116.   $tB = microtime(true);  
  117.   $fP = fSockOpen($server4, $porten, $errno, $errstr, $timeouten);  
  118.   if (!$fP) { return "down"; }  
  119.   $tA = microtime(true);  
  120.   return round((($tA - $tB) * 1000), 0)."ms";  
  121. }
  122. //Kollar om servern 5 är igång
  123. if( $status5 ) {
  124. $Result5 = "<font color='green'><b>online</b></font>";  
  125. } else {
  126. $Result5 = "<font color='red'><b>offline</b></font>";}
  127. //Kollar pingtiden
  128. $porten2 = "8086";
  129. $timeouten = "3";
  130. function ping5($server5, $porten2, $timeouten) {  
  131.   $tB = microtime(true);  
  132.   $fP = fSockOpen($server5, $porten2, $errno, $errstr, $timeouten);  
  133.   if (!$fP) { return "down"; }  
  134.   $tA = microtime(true);  
  135.   return round((($tA - $tB) * 1000), 0)."ms";  
  136. }
  137. //Kollar om servern 6 är igång
  138. if( $status6 ) {
  139. $Result6 = "<font color='green'><b>online</b></font>";  
  140. } else {
  141. $Result6 = "<font color='red'><b>offline</b></font>";}
  142. //Kollar pingtiden
  143. $porten = "8085";
  144. $timeouten = "3";
  145. function ping6($server6, $porten, $timeouten) {  
  146.   $tB = microtime(true);  
  147.   $fP = fSockOpen($server6, $porten, $errno, $errstr, $timeouten);  
  148.   if (!$fP) { return "down"; }  
  149.   $tA = microtime(true);  
  150.   return round((($tA - $tB) * 1000), 0)."ms";  
  151. }
  152. //Kollar om servern 7 är igång
  153. if( $status7 ) {
  154. $Result7 = "<font color='green'><b>online</b></font>";  
  155. } else {
  156. $Result7 = "<font color='red'><b>offline</b></font>";}
  157. //Kollar pingtiden
  158. $porten2 = "8086";
  159. $timeouten = "3";
  160. function ping7($server7, $porten2, $timeouten) {  
  161.   $tB = microtime(true);  
  162.   $fP = fSockOpen($server7, $porten2, $errno, $errstr, $timeouten);  
  163.   if (!$fP) { return "down"; }  
  164.   $tA = microtime(true);  
  165.   return round((($tA - $tB) * 1000), 0)."ms";  
  166. }
  167. //Kollar om servern 8 är igång
  168. if( $status8 ) {
  169. $Result8 = "<font color='green'><b>online</b></font>";  
  170. } else {
  171. $Result8 = "<font color='red'><b>offline</b></font>";}
  172. //Kollar pingtiden
  173. $porten = "8085";
  174. $timeouten = "3";
  175. function ping8($server8, $porten, $timeouten) {  
  176.   $tB = microtime(true);  
  177.   $fP = fSockOpen($server8, $porten, $errno, $errstr, $timeouten);  
  178.   if (!$fP) { return "down"; }  
  179.   $tA = microtime(true);  
  180.   return round((($tA - $tB) * 1000), 0)."ms";  
  181. }
  182. //Kollar om servern 9 är igång
  183. if( $status9 ) {
  184. $Result9 = "<font color='green'><b>online</b></font>";
  185. } else {
  186. $Result9 = "<font color='red'><b>offline</b></font>";}
  187. //Kollar pingtiden
  188. $porten2 = "8086";
  189. $timeouten = "3";
  190. function ping9($server9, $porten2, $timeouten) {  
  191.   $tB = microtime(true);  
  192.   $fP = fSockOpen($server9, $porten2, $errno, $errstr, $timeouten);  
  193.   if (!$fP) { return "down"; }  
  194.   $tA = microtime(true);  
  195.   return round((($tA - $tB) * 1000), 0)."ms";  
  196. }
  197. //Kollar om servern 10 är igång
  198. if( $status10 ) {
  199. $Result10 = "<font color='green'><b>online</b></font>";  
  200. } else {
  201. $Result10 = "<font color='red'><b>offline</b></font>";}
  202. //Kollar pingtiden
  203. $porten = "8085";
  204. $timeouten = "3";
  205. function ping10($server10, $porten, $timeouten) {  
  206.   $tB = microtime(true);  
  207.   $fP = fSockOpen($server10, $porten, $errno, $errstr, $timeouten);  
  208.   if (!$fP) { return "down"; }  
  209.   $tA = microtime(true);  
  210.   return round((($tA - $tB) * 1000), 0)."ms";  
  211. }
  212. //Kollar om servern 11 är igång
  213. if( $status11 ) {
  214. $Result11 = "<font color='green'><b>online</b></font>";
  215. } else {
  216. $Result11 = "<font color='red'><b>offline</b></font>";}
  217. //Kollar pingtiden
  218. $porten2 = "8086";
  219. $timeouten = "3";
  220. function ping11($server11, $porten2, $timeouten) {  
  221.   $tB = microtime(true);  
  222.   $fP = fSockOpen($server11, $porten2, $errno, $errstr, $timeouten);  
  223.   if (!$fP) { return "down"; }  
  224.   $tA = microtime(true);  
  225.   return round((($tA - $tB) * 1000), 0)."ms";  
  226. }
  227.  
  228. //Kollar om servern 12 är igång
  229. if( $status12 ) {
  230. $Result12 = "<font color='green'><b>online</b></font>";
  231. } else {
  232. $Result12 = "<font color='red'><b>offline</b></font>";}
  233. //Kollar pingtiden
  234. $porten = "8085";
  235. $timeouten = "3";
  236. function ping12($server12, $porten, $timeouten) {  
  237.   $tB = microtime(true);  
  238.   $fP = fSockOpen($server12, $porten, $errno, $errstr, $timeouten);  
  239.   if (!$fP) { return "down"; }  
  240.   $tA = microtime(true);  
  241.   return round((($tA - $tB) * 1000), 0)."ms";  
  242. }
  243.  
  244. //Kollar om servern 13 är igång
  245. if( $status13 ) {
  246. $Result13 = "<font color='green'><b>online</b></font>";
  247. } else {
  248. $Result13 = "<font color='red'><b>offline</b></font>";}
  249. //Kollar pingtiden
  250. $porten2 = "8086";
  251. $timeouten = "3";
  252. function ping13($server13, $porten2, $timeouten) {  
  253.   $tB = microtime(true);  
  254.   $fP = fSockOpen($server13, $porten2, $errno, $errstr, $timeouten);  
  255.   if (!$fP) { return "down"; }  
  256.   $tA = microtime(true);  
  257.   return round((($tA - $tB) * 1000), 0)."ms";  
  258. }
  259.  
  260. //Kollar om servern 14 är igång
  261. if( $status14 ) {
  262. $Result14 = "<font color='green'><b>online</b></font>";
  263. } else {
  264. $Result14 = "<font color='red'><b>offline</b></font>";}
  265. //Kollar pingtiden
  266. $porten3 = "8087";
  267. $timeouten = "3";
  268. function ping14($server14, $porten3, $timeouten) {  
  269.   $tB = microtime(true);  
  270.   $fP = fSockOpen($server14, $porten3, $errno, $errstr, $timeouten);  
  271.   if (!$fP) { return "down"; }  
  272.   $tA = microtime(true);  
  273.   return round((($tA - $tB) * 1000), 0)."ms";  
  274. }
  275.  
  276. ?>
  277. <center><?php echo "Login page "; ?> is  <?php echo $Result50; echo " with ping "; echo ping50("109.234.77.11", 8484, 10);?>.</center>
  278.  
  279.  
  280. <center><?php echo "Channel 1 "; ?> is  <?php echo $Result1; echo " with ping "; echo ping1("109.234.77.20", 8585, 10);?>.</center>
  281. <center><?php echo "Channel 2 "; ?> is  <?php echo $Result2; echo " with ping "; echo ping2("109.234.77.21", 8585, 10);?>.</center>
  282. <center><?php echo "Channel 3 "; ?> is  <?php echo $Result3; echo " with ping "; echo ping3("109.234.77.21", 8586, 10);?>.</center>
  283. <center><?php echo "Channel 4 "; ?> is  <?php echo $Result4; echo " with ping "; echo ping4("109.234.77.22", 8585, 10);?>.</center>
  284. <center><?php echo "Channel 5 "; ?> is  <?php echo $Result5; echo " with ping "; echo ping5("109.234.77.22", 8586, 10);?>.</center>
  285. <center><?php echo "Channel 6 "; ?> is  <?php echo $Result6; echo " with ping "; echo ping6("109.234.77.23", 8585, 10);?>.</center>
  286. <center><?php echo "Channel 7 "; ?> is  <?php echo $Result7; echo " with ping "; echo ping7("109.234.77.23", 8586, 10);?>.</center>
  287. <center><?php echo "Channel 8 "; ?> is  <?php echo $Result8; echo " with ping "; echo ping8("109.234.77.24", 8585, 10);?>.</center>
  288. <center><?php echo "Channel 9 "; ?> is  <?php echo $Result9; echo " with ping "; echo ping9("109.234.77.24", 8586, 10);?>.</center>
  289. <center><?php echo "Channel 10 "; ?> is  <?php echo $Result10; echo " with ping "; echo ping10("109.234.77.25", 8585, 10);?>.</center>
  290. <center><?php echo "Channel 11 "; ?> is  <?php echo $Result11; echo " with ping "; echo ping11("109.234.77.25", 8586, 10);?>.</center>
  291. <center><?php echo "Channel 12 "; ?> is  <?php echo $Result12; echo " with ping "; echo ping12("109.234.77.26", 8585, 10);?>.</center>
  292. <center><?php echo "Channel 13 "; ?> is  <?php echo $Result13; echo " with ping "; echo ping13("109.234.77.26", 8586, 10);?>.</center>
  293. <center><?php echo "Channel 14 "; ?> is  <?php echo $Result14; echo " with ping "; echo ping14("109.234.77.27", 8587, 10);?>.</center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement