Server Status Script Acil Yardım
6
●643
- 10-06-2010, 00:00:23Üyeliği durdurulduMerhaba Arkadaşlar Elimde Bir Zamanlar Vardı Fakat Arşiv'de bulamıyorum PHP Yazılmış Server'in İşlemci , ram , hdd , mysql , vs herşeyını anlık gosterıyordu bana bu tarz script lazım elınde olan paylaşırsa sevinirim
- 10-06-2010, 23:43:12
<?php function checkServer($server){ $Email = "email@sunucu.com, email2@sunucu.com"; while (list($key,$port)=each($server[ports])) { $alertEmail = 0; $fp = fsockopen($server[ip], $port, &$errno, &$errstr, 4); $serviceName = array( "21" =>"FTP ", "22" =>"SSH ", "25" =>"SMTP/Exim", "53" =>"BIND/DNS ", "80" =>"HTTP/DNS ", "110" =>"POP3 ", "3306"=>"MySQL "); if (!$fp) { $data_p = "<td width=\"25\" align=\"center\"><img src=\"http://www.myclup.net/down.gif\"><!-- ($server[ip]:$port) --></td>"; $alertEmail = 1; // 1=on, 0=off $status_p = "$serviceName[$port]: DOWN <---\n"; } else { $data_p = "<td width=\"25\" align=\"center\"><img src=\"http://www.myclup.net/up.gif\"><!-- ($server[ip]:$port) --></td>"; $status_p = "$serviceName[$port]: UP\n"; fclose($fp); } $data .= $data_p; $status .= $status_p; } if ($alertEmail) { $today = date("m-d-Y H:m:s"); $subject = "Sunucu! : $server[name]"; $body = "----------------------------------\n"; $body .= "Sunucu : $server[name]\n"; $body .= "IP : $server[ip]\n"; $body .= "Zaman : $today\n"; $body .= "----------------------------------\n\n"; $msg = $status.$body; mail($Email, $subject, $msg); } return $data; } ?> <table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"> <tr bgcolor="#808080" style="font-weight:bold;color:#ffffff;"> <td>Sunucu Adı</td> <td>Bilgi</td> <td>Http</td> <td>FTP</td> <td>SSH</td> <td>MySQL</td> <td>Mail</td> </tr> <tr> <td bgcolor="#c0c0c0">Sunucu adı</td> <td align="center" bgcolor="#c0c0c0">Bilgi</td> <?php $server[ip] = "Sunucu İp Adresi"; $server[name] = "Sunucu Adı"; $server[ports] = array("80","21","22","3306","25"); echo checkServer($server); ?> </tr> </table>
?

