Server Health Immediate Display table

Source: Internet
Author: User
Tags php tutorial

<table border=0><tr><td bgcolor=litered width=100% colspan= "9" ><p align= "center" ><b> Server Health Immediate Display table </b><center>
<?php Tutorial
Set_time_limit (0);
Echo strftime ("%y year%m Month%d days");
?>
</td></tr>
&LT;TR&GT;&LT;TD bgcolor= "#cococo" >ip address </td><td bgcolor= "#cococo" > Detection time </td>
&LT;TD bgcolor= "#cococo" >ftp </td>
&LT;TD bgcolor= "#cococo" >telnet</td><td bgcolor= "#cococo" >smtp </td>
&LT;TD bgcolor= "#cococo" >dns</td><td bgcolor= "#cococo" >http </td>
&LT;TD bgcolor= "Cococo" >pop3</td><td bgcolor= "#cococo" >finger </td>
</td></center>

<?php
This program must start Php_sockets.dll
$port =array (22,23,25,53,80,110,79);
$filename = "Host.txt";
$FL =file ($filename);
for ($i =0; $i <count ($FL); $i + +) {
$a =preg_split ('///', $FL [$i]);
$name []= $a [0];
$IP []= $a [1];
$yn []= $a [2];
}
for ($j =0; $j <count ($FL); $j + +) {
echo "<tr><td bgcolor=yellow>
$name [$j]</td><td bgcolor=liteblue> ". Date (" H:i:s a ")." </td> ";
For ($i =0 $i <7; $i + +) {
if (substr ($yn [$j], $i, 1) = = "1") {
@ $result [$i]=fsockopen ($ip [$j], $port [$i], $serno, $ERRSTR, 1);
if ($result [$i]) {
echo "<td bgcolor=litegreen> normal </td>";
} else {
echo "&LT;TD bgcolor=red> failure </td>";
}
} else {
echo "<td bgcolor=litegreen>n/a</td>";
}
}
echo "</tr>";
}
?>


<TR><TD Bgcolor=litegray width=100% colspan= "9" > Remark:<br>

1. This test table is the unit to the units of the simple server detection, does not mean that the server must be able to operate normally <br>
2.N/A representative not detected .<br></td></tr></table>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.