List contains host and services

Hi,

i’m looking for a way to have a list in icingaweb2 including the host AND services with problems in one list.

I currently have this: monitoring/list/services?hostgroup_name=cgn&(host_problem=1|service_problem=1).
The filter seems to be correct, but the URL /services is the problem.

Is there a list (or anything else excluding /tactical to get this?

Thank you!

I do think this is not possible, but if you only need them in one view you can have a look at dashboards. Simple take the view you want and then press the add to dashboard on the top. With the first one create a new dashboard, with the second one choose to add it to the newly created one.

1 Like

Hey Uwe,

unfortunately Icinga Web 2 as it is with the known modules has no possibility to archive this. I had the same issue.

What you can do is: Create your own Icinga Web 2 Module that produces that lists. It is somehow a little work but you do not have to do all from scratch. For many things you can use the library of the monitoring module and basically copy and put together the functionality from (Controller + View Script):

  • Monitoring/List/Services
  • Monitoring/List/Hosts

Limitations:

  • Order, filter, search operations relies to service or host object (not possible to integrate if you do not want to rewrite the functionality)
  • Monitoring Module changes can crash your own module

This is an incomplete solution but maybe you get the idea how an self made controller could look like:

<?php

namespace Icinga\Module\<Your Module>\Controllers;

use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Backend\MonitoringBackend;

class CommonController extends Controller
{
   
    public function listAction() {
        $this->backend = MonitoringBackend::instance();

        $hosts = $this->backend->select()->from('hoststatus', array(
            'host_icon_image',
            'host_icon_image_alt',
            'host_name',
            'host_display_name',
           ...
           ));

        $services = $this->backend->select()->from('servicestatus', array(
            'host_name',
            'host_display_name',
            'host_state',
            'service_description',
            'service_display_name',
             ....
            ));

        // dont't forget restrictions + filter 
            
        $this->view->hosts = $hosts;
        $this->view->services = $services;
?>

For the view script you can more or less copy parts from the corresponding view scripts of services and hosts in the monitoring module.

Good luck.