显示系统负载代码
2014-05-21 06:40:23 -0400
<br>echo '系统负载:<br>';
$f=sys_getloadavg();
if(0<$f[0] && $f[0]<20) {
echo "<font color='green'>正常<br>1秒:$f[0]|5秒:$f[1]|15秒:$f[2]</font>";
} elseif(20<=$f[0] && $f[0]<=30){
echo "<font color='yellow'>警告<br>1min:$f[0]<br>5min:$f[1]<br>15min:$f[2]</font>";
}elseif(30<$f[0]) {
echo "<font color='red'>报警<br>1min:$f[0]<br>5min:$f[1]<br>15min:$f[2]</font>";
}else{
echo '未知错误';
}
echo '<br>';
Back to home
Subscribe |
Register |
Login
| N