php监控服务的运行情况

浏览:705 发布日期:2017/06/19 分类:系统代码
php监控服务的运行情况
<?php
header('content-type:text/html;charset=utf-8');
set_time_limit(0);
error_reporting(E_WARNING);
$radius=array(
'106.187.93.138'=>array('url'=>'https://manager.linode.com/linodes/dashboard/TXVPN_Pro_Radius','urlbefore'=>'https://manager.linode.com/session/index?r=/linodes/dashboard/TXVPN_Pro_Radius'),
);
function pings($ip,$time) {
exec('ping -n 1 -w '.$time.' '.$ip,$list);
$errorlog=$list[2];
$encode = mb_detect_encoding($errorlog, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
//echo $encode;
$str_encode = mb_convert_encoding($errorlog, 'UTF-8', $encode);
/*echo $str_encode;*/
if('请求超时。' === $str_encode){
return $ip;
}else{
return false;
}
}
评论( 相关
后面还有条评论,点击查看>>