麒麟线路表
This commit is contained in:
@@ -5,28 +5,30 @@
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-03 11:04:15
|
||||
* @LastEditors: “wanyongkang” “937888580@qq.com”
|
||||
* @LastEditTime: 2024-01-04 15:30:18
|
||||
* @LastEditTime: 2024-01-15 16:46:41
|
||||
*/
|
||||
|
||||
use extend\jinyouapi\jinyou;
|
||||
|
||||
$is_script = 1;
|
||||
include_once __DIR__ . '/../../index.php';
|
||||
include_once __DIR__ . '/auto_format.php';
|
||||
|
||||
// // //测试用----------------------------------------------------------------------------------------------------------
|
||||
// $dnx_has_exit = [];
|
||||
// $qilin = new jinyou;
|
||||
|
||||
// //先锋
|
||||
// $xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P'];
|
||||
// $qilin_api_data = (array)((array)((array)($qilin::getDynamicLine()))['res'])['data'];
|
||||
|
||||
|
||||
// if($xianfeng){
|
||||
// $xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv');
|
||||
// $xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w');
|
||||
// //写入先锋文件
|
||||
// xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
|
||||
// fclose($xianfeng_f);
|
||||
// if ($qilin_api_data) {
|
||||
// $qilin_data = get_product(__DIR__ . '/data/qilin.csv');
|
||||
// $qilin_f = fopen(__DIR__ . '/data/qilin.csv', 'w');
|
||||
// qilin_getList($qilin_api_data, $qilin_f, $all,$qilin_data);
|
||||
// fclose($qilin_f);
|
||||
// }
|
||||
// die;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
$dnx_has_exit = [];
|
||||
|
||||
//强子迅联特征码
|
||||
$sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r');
|
||||
|
||||
@@ -152,6 +154,19 @@ xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
|
||||
fclose($xianfeng_f);
|
||||
}
|
||||
|
||||
//麒麟动态
|
||||
$dnx_has_exit = [];
|
||||
$qilin = new jinyou;
|
||||
|
||||
$qilin_api_data = (array)((array)((array)($qilin::getDynamicLine()))['res'])['data'];
|
||||
|
||||
if ($qilin_api_data) {
|
||||
$qilin_data = get_product(__DIR__ . '/data/qilin.csv');
|
||||
$qilin_f = fopen(__DIR__ . '/data/qilin.csv', 'w');
|
||||
qilin_getList($qilin_api_data, $qilin_f, $all,$qilin_data);
|
||||
fclose($qilin_f);
|
||||
}
|
||||
|
||||
|
||||
// $time = time();
|
||||
// $noce = md5(time());
|
||||
@@ -798,6 +813,72 @@ function mogu_getList($data, &$file, &$all )
|
||||
|
||||
}
|
||||
|
||||
//麒麟服务器解析规则
|
||||
function qilin_getList($data, &$file, &$all, $exit )
|
||||
{
|
||||
global $dnx_exit, $dnx_has_exit;
|
||||
$key = '';
|
||||
$list1 = [];
|
||||
|
||||
$province_record = [];
|
||||
|
||||
foreach ($data as $val) {
|
||||
$val = (array)$val;
|
||||
$record = [];
|
||||
$record['name'] = '麒麟';
|
||||
|
||||
$record['city'] = $val['info']->province_name;
|
||||
$province_record[] = $val['info']->province_name;
|
||||
|
||||
$key = $record['city'];
|
||||
$list1[$key][] = $record;
|
||||
|
||||
$record['city'] = $val['info']->province_name.'混拨';
|
||||
$record['supply'] = '';
|
||||
$record['ip'] = '';
|
||||
$record['daikuan'] = '';
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = '正常';
|
||||
$record['status'] = '';
|
||||
$record['nasname'] = $val['info']->province_domain;
|
||||
$list1[$key][] = $record;
|
||||
|
||||
foreach($val['line'] as $city_info) {
|
||||
$city_info = (array)$city_info;
|
||||
|
||||
$record['city'] = $city_info['city_name'];
|
||||
$record['supply'] = $city_info['isp'];
|
||||
|
||||
$record['ip'] = '';
|
||||
$record['daikuan'] = '';
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = $city_info['status'] ? '正常' : '故障';
|
||||
$record['status'] = '';
|
||||
$record['nasname'] = $city_info['domain'];
|
||||
$list1[$key][] = $record;
|
||||
|
||||
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
|
||||
fputcsv($dnx_exit, [$record['name'], explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach ($list1 as $val) {
|
||||
foreach ($val as $net_data) {
|
||||
|
||||
fputcsv($file, $net_data);
|
||||
fputcsv($all, $net_data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function laoying_getList($list, &$file, &$all, $exit)
|
||||
{
|
||||
global $dnx_exit, $dnx_has_exit;
|
||||
|
||||
Reference in New Issue
Block a user