/** * Get command of a Host * * * @method get * @route /host/[i:id]/command */ public function getHostCommandAction() { $requestParam = $this->getParams('named'); $inerithedCommand = HostRepository::getInheritanceValues($requestParam['id'], true, array('command_command_id')); $commandName = ""; if (isset($inerithedCommand['command_command_id']) && !is_null($inerithedCommand['command_command_id'])) { $command = Command::getParameters($inerithedCommand['command_command_id'], 'command_name'); $commandName = $command['command_name']; } $this->router->response()->json($commandName); }
/** * Display the realtime snapshot of a host * * @method get * @route /host/snapshotslide/[i:id] */ public function snapshotslideAction() { $params = $this->getParams(); $data['configurationData'] = HostConfRepository::getInheritanceValues($params['id'], true); $data['configurationData']['host_id'] = $params['id']; $host = HostConf::get($params['id'], 'host_name'); $data['configurationData']['host_name'] = $host['host_name']; $data['realtimeData'] = HostRealtime::get($params['id']); $hostInformations = HostRepository::formatDataForSlider($data); $servicesStatus = ServiceRepository::countAllStatusForHost($params['id']); $view_url = $this->router->getPathFor("/centreon-realtime/host/" . $params['id']); $this->router->response()->json(array('hostInformations' => $hostInformations, 'servicesStatus' => $servicesStatus, 'view_url' => $view_url, 'success' => true)); }