mirror of
https://github.com/Icinga/icingaweb2-module-graphite.git
synced 2026-05-28 04:34:57 -04:00
parent
59d6f7de54
commit
def866f5cf
1 changed files with 0 additions and 48 deletions
|
|
@ -73,54 +73,6 @@ class ShowController extends Controller
|
|||
exit;
|
||||
}
|
||||
|
||||
public function XXXserviceAction()
|
||||
{
|
||||
$this->handleDatasourceToggles();
|
||||
$this->handleGraphParams();
|
||||
$hostname = $this->view->hostname = $this->params->get('host');
|
||||
$service = $this->view->service = $this->params->get('service');
|
||||
if (! $hostname) {
|
||||
throw new NotFoundError('Host is required');
|
||||
}
|
||||
if (! $service) {
|
||||
throw new NotFoundError('Service is required');
|
||||
}
|
||||
$this->getTabs()->add('service', array(
|
||||
'label' => $this->translate('Graphite - Single service'),
|
||||
'url' => $this->getRequest()->getUrl()
|
||||
))->activate('service');
|
||||
|
||||
$imgs = array();
|
||||
$this->view->templates = array();
|
||||
|
||||
foreach ($this->templateStore->loadTemplateSets() as $setname => $set) {
|
||||
|
||||
$patterns = $set->getBasePatterns();
|
||||
if (! array_key_exists('icingaService', $patterns)) continue;
|
||||
|
||||
foreach ($set->loadTemplates() as $key => $template) {
|
||||
|
||||
if (strpos($template->getFilterString(), '$service') === false) continue;
|
||||
|
||||
$this->view->templates[$key] = $template;
|
||||
|
||||
$imgs[$key] = $this->graphiteWeb
|
||||
->select()
|
||||
->from($template->getFilterString())
|
||||
->where('hostname', $hostname)
|
||||
->where('service', $service)
|
||||
->getImages($template);
|
||||
|
||||
foreach ($imgs[$key] as $img) {
|
||||
$this->applyGraphParams($img)
|
||||
->showLegend(! $this->params->get('hideLegend', false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->images = $imgs;
|
||||
}
|
||||
|
||||
protected function loadTemplate()
|
||||
{
|
||||
$this->handleTemplateParams();
|
||||
|
|
|
|||
Loading…
Reference in a new issue