include_once PATH_BASEKIT_DT; include_once PATH_BASEKIT_DB; include_once PATH_BASEKIT_DBER; //忽略用户断开 ignore_user_abort(1); //接收参数 $get_time_start = isset($_POST['time_start']) ? (int) strtotime($_POST['time_start']) : 0; $get_time_end = isset($_POST['time_end']) ? (int) strtotime($_POST['time_end']) : 0; $get_realtime = (int) $_POST['realtime'] == 1 ? true : false; $get_realkeep = (int) $_POST['realkeep'] == 1 ? true : false; $get_lay_time = isset($_POST['relay_time']) ? (int) $_POST['relay_time'] : 8; $get_host = $_POST['host_name']; //设定错误控制 Baserror::set('CLI', PATH_LOG, 'api.log', true, true); //创建对象 $obj_server = new Bkex_server(); $arr_server = $obj_server->getservers($get_host); //结果集 $arr_json = array('data' => array(), 'status' => false); //获取目标服务器 if ($arr_server !== false) { $arr_system = $obj_server->system_get($arr_server); $obj_charts = new Bkex_charts(); //判断模式 if ($get_realtime) { //实时模式,采集数据并入库 $obj_dber = new Bkex_Dber($arr_server, $get_realtime, $get_realkeep); $obj_dt = new Bkex_Dt(); $obj_dt->fetch($arr_server['url']); $arr_cpu = $obj_dt->cpu(); $arr_mem = $obj_dt->mem();
*/ //载入一些玩意 include_once 'include/init.php'; include_once 'include/init_view.php'; include_once 'include/init_user.php'; include_once 'include/init_lang.php'; include_once 'include/init_install.php'; //过渡页模板填充 $obj_view->sign('_TPL_PL', $obj_lang->get('page-loading-text')); //检查是否安装 if ($obj_install->installed()) { //检查是否登陆 if ($obj_user->islogin()) { //已登录,抓取服务器列表 include_once PATH_BASEKIT_SERVER; $obj_server = new Bkex_server(); $arr_server = $obj_server->getservers(); //模板操作 $obj_view->sign('_TPL_HT', $obj_lang->get('navbar-text-index')); $obj_view->sign('_TPL_TZ_1', $obj_lang->get('index-time-zoom-1')); $obj_view->sign('_TPL_TZ_2', $obj_lang->get('index-time-zoom-2')); $obj_view->sign('_TPL_PANNEL', true); $obj_view->sign('NAVINT', 1); $obj_view->sign('SERVER', $arr_server); $obj_view->make('index.php'); } else { //未登录 header('Location: login.php'); } } else { header('Location: welcome.php');