public function getSearchResults($input) { $results = array(); if (preg_match("/^RS-(\\w+)-(\\w+)/", $input->location, $matches)) { if ($matches[2] == 'deployment') { $inputArray = array('exec' => 'rsnagios', 'region' => $matches[1], 'deployment' => $input->srchparam); } elseif ($matches[2] == 'serverarray') { $inputArray = array('exec' => 'rsnagios', 'region' => $matches[1], 'array' => $input->srchparam); } else { return $results; } RSArgParser::setRSArgs($inputArray); $output = RSQueryWrapper::execute(RSArgParser::getQueryLocation(), true); foreach ($output as $idx => $hostData) { if (empty($hostData) || !isset($hostData['host_name']) || !isset($hostData['address'])) { continue; } $host = $hostData['host_name']; $results[$host] = $hostData; } } return $results; }