yunniu
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-03 11:04:15
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2022-04-28 17:57:51
|
||||
* @LastEditTime: 2022-04-28 18:32:46
|
||||
*/
|
||||
$is_script = 1;
|
||||
include_once __DIR__ . '/../../index.php';
|
||||
@@ -120,7 +120,7 @@ if(!empty($yunniu)){
|
||||
$yunniu_f = fopen(__DIR__ . '/data/yunniu.csv', 'w');
|
||||
//写入火狐文件
|
||||
$yunniu_data = get_product(__DIR__ . '/data/yunniu.csv');
|
||||
huohu_getList($yunniu, $yunniu_f, $all,$yunniu_data);
|
||||
yunniu_getList($yunniu, $yunniu_f, $all,$yunniu_data);
|
||||
fclose($yunniu_f);
|
||||
}
|
||||
|
||||
@@ -292,6 +292,54 @@ function huohu_getList($data, &$file, &$all, $exit)
|
||||
$online = ['故障', '正常','故障'];
|
||||
$list = [];
|
||||
|
||||
$province_record = [];
|
||||
foreach ($data as $info){
|
||||
$record = [];
|
||||
$record['name'] = '火狐静态';
|
||||
//如果存在 不为空 则
|
||||
if (!in_array( $info['province'], $province_record)) {
|
||||
$record['city'] = $info['province'];
|
||||
$province_record[] = $info['province'];
|
||||
$key = $record['city'];
|
||||
$list[$key][] = $record;
|
||||
}
|
||||
//匹配所有的城市
|
||||
//每一个城市再解析获取城市和剩余数量
|
||||
|
||||
$record['city'] = $info['city'];
|
||||
$record['supply'] = $info['displayname'];
|
||||
$record['ip'] = '';
|
||||
$record['daikuan'] = '';
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = $online[$info['status']];
|
||||
$record['status'] = '';
|
||||
$record['nasname'] = $info['ip'];
|
||||
|
||||
$list[$key][] = $record;
|
||||
|
||||
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
|
||||
fputcsv($dnx_exit, ['火狐', explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
|
||||
}
|
||||
}
|
||||
foreach ($list as $val) {
|
||||
foreach ($val as $net_data) {
|
||||
|
||||
fputcsv($file, $net_data);
|
||||
fputcsv($all, $net_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//火狐服务器解析规则
|
||||
function yunniu_getList($data, &$file, &$all, $exit)
|
||||
{
|
||||
|
||||
global $dnx_exit, $dnx_has_exit;
|
||||
$online = ['故障', '正常','故障'];
|
||||
$list = [];
|
||||
|
||||
$province_record = [];
|
||||
foreach ($data as $info){
|
||||
$record = [];
|
||||
|
||||
Reference in New Issue
Block a user