Пример #1
0
 public function getServerInfo($server_id)
 {
     $server = monitisWhmcsServer::serverInfo($server_id);
     // all linked ping monitors
     $this->whmcsExt = monitisWhmcsServer::extMonitorsByServerIds($server['id']);
     // get all ping monitors
     $this->allPings = MonitisApi::getExternalMonitors();
     if (@$this->allPings['status'] != 'error' && @$this->allPings['code'] != 101) {
         $this->pingsStatus = null;
         if ($this->allPings && isset($this->allPings['testList'])) {
             $this->allPings = $this->allPings['testList'];
             // get all ping monitors status
             $this->pingsStatus = MonitisApi::externalSnapshot();
         } else {
             $this->allPings = null;
         }
         // all linked internal monitors
         $this->whmcsInt = monitisWhmcsServer::intMonitorsByServerIds($server['id']);
         if (!$this->whmcsInt) {
             $this->whmcsInt = array();
         }
         $agent = $this->getAgent($server['hostname']);
         if ($agent && isset($agent['agentId'])) {
             $this->agentInfo = $agent;
             // get agent info
             $this->agentFullInfo = MonitisApi::getAgentInfo($agent['agentId'], true);
         }
         $server = $this->initServer($server);
     }
     return $server;
 }