GithubHelp home page GithubHelp logo

icinga / icingaweb2-module-cube Goto Github PK

View Code? Open in Web Editor NEW
44.0 17.0 12.0 1.54 MB

Drill-down view for Icinga web 2 based on custom variables

License: GNU General Public License v2.0

PHP 94.46% HTML 0.86% Less 4.68%
icingaweb2 cube icinga module visualization

icingaweb2-module-cube's Introduction

Icinga Cube

PHP Support Build Status Github Tag

Icinga Logo

The Icinga Cube is a tiny but useful Icinga Web module. It currently shows host and service statistics (total count, health) grouped by various custom variables in multiple dimensions.

Cube - Overview

It will be your new best friend in case you are running a large environment and want to get a quick answers to questions like:

  • Which project uses how many servers per environment at which location/site?
    • Who occupies most servers?
    • How many of those are used in production?
    • Which project has only development and test boxes?
  • Which operating system is used for which project and in which environment?
    • Do we still have Debian Lenny?
    • Which projects are to blame for this?
    • Do we have applications where the operating systems used differ in staging and production?
  • Which project uses which operating system version for which application?
    • Which projects have homogeneous environments?
    • Which projects are at a consistent patch level?
    • How many RHEL 6 variants (6.1, 6.2, 6.3...) do we use?
    • Who is running the oldest ones? In production?
  • Which projects are still using physical servers in which environment?

For Businessmen - Drill and Slice

Get answers to your questions. Quick and fully autonomous, using the cube requires no technical skills. Choose amongst all available dimensions and rotate the Cube to fit your needs.

Cube - Configure Dimensions

Want to drill down? Choose a slice and get your answers:

Cube - Configure Dimensions

All facts configured for systems monitored by Icinga can be used for your research.

For Icinga Director users

In case you are using the Icinga Director, in addition to the multi-selection/edit feature the cube provides a nice way to modify multiple hosts at once.

Cube - Director multi-edit

Installation

To install Icinga Cube see Installation.

icingaweb2-module-cube's People

Contributors

al2klimov avatar flourish86 avatar lippserd avatar lum3n avatar nilmerg avatar raviks789 avatar sant-swedge avatar sukhwinder33445 avatar thefeu avatar yhabteab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icingaweb2-module-cube's Issues

Error trying to add a second dimension if the first applies to some hosts only

Hi,

I'm with icingaweb2 2.4.0,
I get to reporting/cube, and then add a first dimension, and that works, i.e. 'hostgroup'

Then getting under "show settings" and want to add another dimension, clicking on 'Add a dimension'
The selection pops up, and on selection what I want, i.e. 'os', then instead of adding the second dimension
the only thing I get is the following error message:

Undefined property: stdClass::$os

When I reverse the example, i.e. first dimension 'os' and then try second dimension 'hostgroup', the first dimension for the 'os' works, but then on the second dimension I get similar error message:

Undefined property: stdClass::$hostgroup

Running the module from git commit: 3107867

Allow matching of array entries in arbitrary positions

Is your feature request related to a problem? Please describe.

When combining the cube module with IcingaDB as a backend it is now possible to operate on array/dictionary entries. But, counterintuitively, these operations happen "in place". Consider the following array variable on two hosts:

host1.fruit = ["apple", "banana", "orange", "papaya"]
host2.fruit = ["banana", "apple", "orange"]

Based on the four different entries for this variable across all hosts, Cube/IcingaDB will offer entries fruit[0-4] in Cube's dimension dropdown. Two problems arise:

  • When dealing with longer lists, fruit[2] is not good enough a denominator for the actual entry at this place of the array. Remembering different arrays for 1000+ hosts is not feasible.
  • fruit[2] will be a different item, depending on the actual array configured for affected hosts.

For above example, only one cube (fruit[2]) would contain both hosts, as item and position match. I'd expect three cubes to contain both hosts, as they got three array items in common.

Describe the solution you'd like

Preferred solution:

In the dropdown menu, offer fruit as a dimension. The operation for arrays would be to slice twice then:

  1. first between hosts/services that possess fruit vs those which don't
  2. then between all occuring array items across all hosts, no matter their respective positions within their arrays. The same implementation would make a nice feature for dictionaries, too.

Fallback solution:

If the method above is not feasible/doable, seeing the actual items in the dropdown and matching them in arbitrary positions of arrays would help, too. I.e. being offered fruit.apple, fruit.banana, fruit.orange etc. instead of fruit[0-4].

Describe alternatives you've considered

We had a close look at using dictionaries instead of arrays, but continue with arrays and Cube behaviour as described above is the preferred and more intuitive/ergonomic solution.

Counts no longer valid after upgrade

Recently upgraded to Icinga 2.8, PHP 7.1, and Icinga Web 2.5.0 from Icinga 2.7.2, PHP 5.4, and Icinga Web 2.4.2

Expected Behavior

Counts in Cube display should match Custom Vars - Overview

Current Behavior

Counts displayed in Cube are very low and some variables are missing compared to Custom Vars - Overview

example:
image

image

Possible Solution

Steps to Reproduce (for bugs)

  1. Upgrade to Icinga v2.8.0
  2. Create view in Cube of any dimension
  3. Compare counts against Custom Vars - Overview

Context

Cube display is misleading

Your Environment

  • Module version (System - About): 1.0.1
  • Icinga Web 2 version and modules (System - About): 2.5.0
  • Icinga 2 version (icinga2 --version): r2.8.0-1
  • Operating System and version: CentOS 7.2
  • Webserver, PHP versions: nginx 1.12, PHP 7.1

Error in SQL syntax if custom var names contain dots

Describe the bug

  • In Icingaweb2/Cube selecting in "Add a dimesion" for example "os.version" the following error occurs

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.version, rollup.hosts_cnt, rollup.hosts_nok, rollup.hosts_unhandled_nok' at line 1, query was: SELECT rollup.os.version AS os.version.........

  • Selecting a dimesion like "check_command" everything is fine

To Reproduce

  1. select a dimension including a dot "." the error occurs
  2. select a dimension without a dot (e.g. "check_command") everything is fine

Expected behavior

A dimension including a dot "." should also be possible

Screenshots

If applicable, add screenshots to help explain your problem.

Your Environment

  • Verion and modules (System - About):
    Icinga version: r2.10.5-1
    Icinga Web 2 Version 2.7.1
    cube module version 1.1.0
    OS: Debian 10 (buster)
    mariadb 10.3.15-1
    PHP 7.3.4-2

Additional context

Thank you in advance for your kind help

Errors: SQL and web

hi,

I tried to test configure multiple hosts (e.G. downtime etc.) but I get errors:

  • Modify

`Failed to load icinga_host "backup.4lin.net"

#0 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(1044): Icinga\Module\Director\Data\Db\DbObject->loadFromDb()
#1 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(2318): Icinga\Module\Director\Data\Db\DbObject::load('backup.4lin.net', Object(Icinga\Module\Director\Db))
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(330): Icinga\Module\Director\Objects\IcingaObject::loadByType('host', 'backup.4lin.net', Object(Icinga\Module\Director\Db))
#3 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(32): Icinga\Module\Director\Web\Controller\ObjectController->loadObject()
#4 /usr/share/icingaweb2/modules/director/application/controllers/HostController.php(20): Icinga\Module\Director\Web\Controller\ObjectController->init()
#5 /usr/share/php/Icinga/Web/Controller/ActionController.php(133): Icinga\Module\Director\Controllers\HostController->init()
#6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(59): Icinga\Web\Controller\ActionController->__construct(Object(Icinga\Web\Request), Object(Icinga\Web\Response), Array)
#7 /usr/share/php/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#8 /usr/share/php/Icinga/Application/Web.php(384): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#9 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#10 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#11 {main}`

  • Show host state

`SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8', query was: SELECT so.name1 AS host_name, SUM( CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) > 0 THEN 0 ELSE 1 END ) AS unhandled_service_count FROM icinga_objects AS so
INNER JOIN icinga_services AS s ON s.service_object_id = so.object_id AND so.is_active = 1
INNER JOIN icinga_servicestatus AS ss ON ss.service_object_id = so.object_id AND ss.current_state > 0
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = s.host_object_id
INNER JOIN (SELECT ho.object_id FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_customvariablestatus AS hcv_hostname ON h.host_object_id = hcv_hostname.object_id AND hcv_hostname.varname = 'hostname' COLLATE latin1_general_ci WHERE (hcv_hostname.varvalue = 'backup') LIMIT 25) AS h ON h.object_id = s.host_object_id GROUP BY so.name1 HAVING (SUM(
CASE
WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) > 0
THEN 0
ELSE 1
END
) > 0)

#0 /usr/share/php/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/php/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
#3 /usr/share/php/Zend/Db/Adapter/Abstract.php(811): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/php/Icinga/Data/Db/DbConnection.php(298): Zend_Db_Adapter_Abstract->fetchPairs(Object(Zend_Db_Select))
#5 /usr/share/php/Icinga/Data/SimpleQuery.php(626): Icinga\Data\Db\DbConnection->fetchPairs(Object(Icinga\Module\Monitoring\Backend\Ido\Query\HostserviceproblemsummaryQuery))
#6 /usr/share/icingaweb2/modules/monitoring/application/controllers/ListController.php(113): Icinga\Data\SimpleQuery->fetchPairs()
#7 /usr/share/php/Zend/Controller/Action.php(516): Icinga\Module\Monitoring\Controllers\ListController->hostsAction()
#8 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('hostsAction')
#9 /usr/share/php/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#10 /usr/share/php/Icinga/Application/Web.php(384): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#11 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#12 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#13 {main}`

  • icingaweb2 2.3.4+fix-1~debmon8+1
  • icinga2 2.5.4-1~debmon8+4

Host variables in service dimension list

Problem:

We have a data field in string format.
This data filed is passed to a host template and thus mapped to each host as a variable.
There it is filled with different values
Furthermore we have a check command, which reads this host variable and passes it as argument to the check.

Cube does not show this variable under services for selection.
Furthermore it is hard to understand when a variable is displayed under services. Which requirements must be fulfilled ?
Please make it more transparent to understand how this dimension list is created and when new values end up in it or a way to populate it yourself.
Thanks

Update of module.info missed for release 1.1.1

Describe the bug

The version number in module.info (1.1.0) does not match the release number (1.1.1). Please upgrade the version number in module.info.

To Reproduce

After upgrading from 1.1.0 to 1.1.1 the WebGUI still displays the old version number.

Expected behavior

Installed version and displayed version number should be the same.

Apply the same restrictions like in monitoring module

Expected Behavior

Cube module does not show more objects than you could see in the monitoring module.

Current Behavior

Cube module does show all objects.

Possible Solution

Apply restrictions from monitoring module or at least provide the possibility to add the same restrictions.

Context

Users are restricted to systems relevant for them in the monitoring module, but can see more than these in the cube.

ref/NC/590017

Make director dependency optional

Describe the bug

Even though this module works fine without director, it has a dependency duty on director, which is completely unnecessary IMHO.

Bildschirmfoto 2021-11-23 um 17 01 09

Additional context

Add any other context about the problem here.

Cube and Director List fields

Hi I have few fields based on Lists from director. When I'm trying to add more then one dimension I get an error

#0 /usr/share/icingaweb2/modules/cube/library/Cube/Ido/IdoHostStatusCubeRenderer.php(21): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(Integer, String, String, Integer, Array)
#1 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(294): Icinga\Module\Cube\Ido\IdoHostStatusCubeRenderer->renderDimensionLabel(String, Object(stdClass))
#2 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(219): Icinga\Module\Cube\CubeRenderer->beginDimension(String, Object(stdClass))
#3 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(201): Icinga\Module\Cube\CubeRenderer->beginDimensionsUpFrom(String, Object(stdClass))
#4 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(190): Icinga\Module\Cube\CubeRenderer->beginDimensionsForRow(Object(stdClass))
#5 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(176): Icinga\Module\Cube\CubeRenderer->renderRow(Object(stdClass))
#6 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(290): Icinga\Module\Cube\CubeRenderer->render(Object(Icinga\Web\View))
#7 zend.view:///usr/share/icingaweb2/modules/cube/application/views/scripts/index/index.phtml(18): Icinga\Module\Cube\Cube->render(Object(Icinga\Web\View))
#8 /usr/share/php/Icinga/Web/View.php(270): include(String)
#9 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render(NULL)
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/Web.php(407): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#19 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#20 {main}

Environment:

  • Module version:1.0.1
  • Icinga Web 2 version and modules: 2.5.1
  • Icinga 2 version (icinga2 --version):r2.8.2-1
  • Operating System and version:Centos 7
  • Webserver, PHP versions: 7.1.8

Enhance display of long facts

Add the possibility to show cubes as a normal treeview and makes this setting global to all users.

Background: We have some long Strings and the cubes aren't readable at all. ;-)

PS: Nice work!

sql error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.varvalue AS operating system, COUNT(*) AS hosts_cnt, SUM(CASE WHEN hs.current_s' at line 1, query was: SELECT rollup.operating system, rollup.hosts_cnt, rollup.hosts_nok, rollup.hosts_unhandled_nok FROM (SELECT sub.operating system, SUM(hosts_cnt) AS hosts_cnt, SUM(hosts_nok) AS hosts_nok, SUM(hosts_unhandled_nok) AS hosts_unhandled_nok FROM (SELECT c_Operating System.varvalue AS operating system, COUNT(*) AS hosts_cnt, SUM(CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END) AS hosts_nok, SUM(CASE WHEN hs.current_state != 0 AND hs.problem_has_been_acknowledged = 0 AND hs.scheduled_downtime_depth = 0 THEN 1 ELSE 0 END) AS hosts_unhandled_nok FROM icinga_objects AS o
INNER JOIN icinga_hosts AS h ON o.object_id = h.host_object_id AND o.is_active = 1
LEFT JOIN icinga_hoststatus AS hs ON hs.host_object_id = h.host_object_id
LEFT JOIN icinga_customvariablestatus AS c_Operating System ON c_Operating System.varname = 'Operating System' AND c_Operating System.object_id = o.object_id GROUP BY c_Operating System.varvalue) AS sub GROUP BY (operating system) WITH ROLLUP) AS rollup ORDER BY (rollup.operating system IS NOT NULL) ASC, rollup.operating system ASC, (rollup.hosts_cnt IS NOT NULL) ASC, rollup.hosts_cnt ASC, (rollup.hosts_nok IS NOT NULL) ASC, rollup.hosts_nok ASC, (rollup.hosts_unhandled_nok IS NOT NULL) ASC, rollup.hosts_unhandled_nok ASC

#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(725): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/icingaweb2/modules/cube/library/Cube/DbCube.php(66): Zend_Db_Adapter_Abstract->fetchAll(Object(Zend_Db_Select))
#5 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(175): Icinga\Module\Cube\DbCube->fetchAll()
#6 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(290): Icinga\Module\Cube\CubeRenderer->render(Object(Icinga\Web\View))
#7 zend.view:///usr/share/icingaweb2/modules/cube/application/views/scripts/index/index.phtml(18): Icinga\Module\Cube\Cube->render(Object(Icinga\Web\View))
#8 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#9 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render('index/index.pht...')
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...', NULL)
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('indexAction')
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#19 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#20 {main}

Data fields / custom vars do not show up or take a long time to do so

Describe the bug

It seems some of my data fields do not show up under services/hosts within Reporting > Cube (more often it's a service). I tried to see if any errors were thrown in icinga2.log or icingweb2.log and the Chrome browser console.

Is this a matter of propagation? I’ve seen this too when I delete a data field called “applications” (yes, confirming to delete dependent host assignments), and adding them, they never show up.

NOTE: This seems to apply to arrays, as my data list of string type shows up fine:
image

To Reproduce

Provide a link to a live example, or an unambiguous set of steps to reproduce this issue. Include configuration, logs, etc. to reproduce, if relevant.

  1. Add data filed called "service_group" of type Array
  2. Add a few services to this array on any service apply/assignment rule.
  3. Deploy any changes if needed with Director
  4. Go to Cube and try to access this array.

Expected behavior

The array var should show up.

Screenshots

image
image
image
image
image

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): Icinga Web 2 Version 2.7.3, Git commit 06cabfe8ba28cf545a42c92f25484383191a4e51
  • Web browser used: Chrome 80.0.3987.122
  • Icinga 2 version used (icinga2 --version): 2.11.3-1
  • PHP version used (php --version):
# /opt/rh/rh-php71/root/usr/sbin/php-fpm --version
PHP 7.1.30 (fpm-fcgi) (built: Nov  4 2019 10:09:22)
  • Server operating system and version: CentOS 7.7

Additional context

Add sort control

Add sort control to sort host and service dimensions by value and state (severity).

Cannot add any "Cube" dimension

Hello community, need some help

I met a problem (or not) - cannot add any "Cube" dimension, by clicking on "+ add a dimension" nothing happened.

System:

  • Debian 9

Server:

  • Icinga "r2.6.0-1"
  • Icinga Web "2.5.1"

Modules:

  • Cube "1.0.1"
  • Director "master" (what's wrong with this version O_o)
  • Monitoring "2.5.1"
  • Migrate "2.5.1"

Other:

  • Apache "2.4.25"
  • PHP "7.0.27"

CLI commands for host and service status by dimension(s)

Implement the missing cli command for the cube hoststatus.

Expected Behavior

icingacli cube hoststatus

list the cli commands for hoststatus

Current Behavior

icingacli cube
The 'cube' module does not provide any CLI commands

Possible Solution

Implement some commands for the hoststatus cube.

icingacli cube hoststatus

cube for host status
====================

Available actions:

  additional      show addtitional dimensions (doesn't work)
  columns         list the columns of the requestet cube
  dimensions      list all available dimensions
  examples        show examples
  facts           list facts for the cube
  fullqueryNoNull   show the sql query with no null values in the cube.
  info            show information
  list            fetch data from request cube, option --dimensions= required
  listSlices      list slices (doesn't work)

Show help on a specific action: icingacli help hoststatus 

The "list" command has the following options:

fetch data from request cube, option --dimensions= required
===========================================================================

USAGE

  icingacli cube hoststatus list --dimensions=[dimensions] [options]

OPTIONS

  --format=csv|json|sql

EXCEPTIONS

  MissingParameter is thrown if dimensions is not given

EXAMPLE

  icingacli cube hoststatus list --dimensions=OS

An example output with format=csv is:

icingacli cube hoststatus list --dimensions=os --format=csv

os,hosts_cnt,hosts_nok,hosts_unhandled_nok
"","214","0","0"
"","215","0","0"
"Linux","1","0","0"

The format=sql show simple the underlying query. To access the "fullquery" I had to change in interface Icinga\Module\Cube\DbCube::fullquery from protected to public.

The example with format=sql is:

icingacli cube hoststatus list --dimensions=os --format=sql

SELECT rollup.os, rollup.hosts_cnt, rollup.hosts_nok, rollup.hosts_unhandled_nok FROM (SELECT sub.os, SUM(hosts_cnt) AS hosts_cnt, SUM(hosts_nok) AS hosts_nok, SUM(hosts_unhandled_nok) AS hosts_unhandled_nok FROM (SELECT c_os.varvalue AS os, COUNT(*) AS hosts_cnt, SUM(CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END) AS hosts_nok, SUM(CASE WHEN hs.current_state != 0 AND hs.problem_has_been_acknowledged = 0 AND hs.scheduled_downtime_depth = 0 THEN 1 ELSE 0 END) AS hosts_unhandled_nok FROM icinga_objects AS o
 INNER JOIN icinga_hosts AS h ON o.object_id = h.host_object_id AND o.is_active = 1
 LEFT JOIN icinga_hoststatus AS hs ON hs.host_object_id = h.host_object_id
 LEFT JOIN icinga_customvariablestatus AS c_os ON c_os.varname = 'os' AND c_os.object_id = o.object_id GROUP BY c_os.varvalue) AS sub GROUP BY (os) WITH ROLLUP) AS rollup ORDER BY (rollup.os IS NOT NULL) ASC, rollup.os ASC, (rollup.hosts_cnt IS NOT NULL) ASC, rollup.hosts_cnt ASC, (rollup.hosts_nok IS NOT NULL) ASC, rollup.hosts_nok ASC, (rollup.hosts_unhandled_nok IS NOT NULL) ASC, rollup.hosts_unhandled_nok ASC

I fork the module and create a branch "feature-cli-command-hoststatus-WIP". This branch will be only for develop. If everything is fine I will create the final branch from which I create the pull request.

Please give some infos, if the feature will be accepted, so that I could continue with implementing the feature. Give the info if I could change the method "fullquery" like described.

Changing the order of the dimensions leads to a stack trace

Describe the bug

If you click on the up or down arrow to change the order of the dimension, the stack trace error occurs.

To Reproduce

  1. Add two or more dimensions
  2. Change the order of dimensions

Screenshots

Screenshot 2021-07-05 at 11 24 41

Screenshot 2021-07-05 at 11 24 58

Your Environment

  • Icinga Web 2 version and modules (System - About): 2.8.2
  • PHP version used (php --version): PHP 8.0.7

Grouping error: 7 ERROR: column "cv.customvariablestatus_id"

Describe the bug

When enabling v1.1.0:

 Grouping error: 7 ERROR: column "cv.customvariablestatus_id" must appear in the GROUP BY clause or be used in an aggregate function

When using master, I get as far as this:
image
image

SQLSTATE[42883]: Undefined function: 7 ERROR: function rollup(text) does not exist
LINE 4: ...ROUP BY "c_cluster_env".varvalue) AS sub GROUP BY ROLLUP ("c...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts., query was: SELECT rollup."cluster_env", rollup."hosts_cnt", rollup."hosts_down", rollup."hosts_unhandled_down", rollup."hosts_unreachable", rollup."hosts_unhandled_unreachable" FROM (SELECT sub."cluster_env", SUM(hosts_cnt) AS hosts_cnt, SUM(hosts_down) AS hosts_down, SUM(hosts_unhandled_down) AS hosts_unhandled_down, SUM(hosts_unreachable) AS hosts_unreachable, SUM(hosts_unhandled_unreachable) AS hosts_unhandled_unreachable FROM (SELECT "c_cluster_env"."varvalue" AS "cluster_env", COUNT(*) AS "hosts_cnt", SUM(CASE WHEN hs.current_state = 1 THEN 1 ELSE 0 END) AS "hosts_down", SUM(CASE WHEN hs.current_state = 1 AND hs.problem_has_been_acknowledged = 0 AND hs.scheduled_downtime_depth = 0 THEN 1 ELSE 0 END) AS "hosts_unhandled_down", SUM(CASE WHEN hs.current_state = 2 THEN 1 ELSE 0 END) AS "hosts_unreachable", SUM(CASE WHEN hs.current_state = 2 AND hs.problem_has_been_acknowledged = 0 AND hs.scheduled_downtime_depth = 0 THEN 1 ELSE 0 END) AS "hosts_unhandled_unreachable" FROM icinga_objects AS ho
INNER JOIN icinga_hosts AS h ON h.host_object_id = ho.object_id AND ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_customvariablestatus AS "c_cluster_env" ON "c_cluster_env".varname = 'cluster_env' AND "c_cluster_env".object_id = ho.object_id GROUP BY "c_cluster_env".varvalue) AS sub GROUP BY ROLLUP ("cluster_env")) AS rollup ORDER BY (rollup."cluster_env" IS NOT NULL) ASC, rollup."cluster_env" ASC, (rollup."hosts_cnt" IS NOT NULL) ASC, rollup."hosts_cnt" ASC, (rollup."hosts_down" IS NOT NULL) ASC, rollup."hosts_down" ASC, (rollup."hosts_unhandled_down" IS NOT NULL) ASC, rollup."hosts_unhandled_down" ASC, (rollup."hosts_unreachable" IS NOT NULL) ASC, rollup."hosts_unreachable" ASC, (rollup."hosts_unhandled_unreachable" IS NOT NULL) ASC, rollup."hosts_unhandled_unreachable" ASC

A clear and concise description of what the issue is.

To Reproduce

Provide a link to a live example, or an unambiguous set of steps to reproduce this issue. Include configuration, logs, etc. to reproduce, if relevant.

  1. Enable module on the below environment.
  2. Try to open Reporting (v1.1.0)> Cube or create a dimension (master)

Expected behavior

Module should open fine.

Screenshots

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): Icinga Web 2 Version 2.7.3, Git commit 06cabfe8ba28cf545a42c92f25484383191a4e51
  • Web browser used: Chrome 80.0.3987.122
  • Icinga 2 version used (icinga2 --version): 2.11.3-1
  • PHP version used (php --version):
# /opt/rh/rh-php71/root/usr/sbin/php-fpm --version
PHP 7.1.30 (fpm-fcgi) (built: Nov  4 2019 10:09:22)
  • Server operating system and version: CentOS 7.7

Additional context

Using PostgreSQL 9.2.24 backend.

Mixed case vars do not work

There has a strtolower() been introduced for 1.x compatibility, that one causes this problem. Needs to be fixed.

Postgres 9.2.24 issue

Hi
I have just installed Cube on latest version of Icinga Web with Postgresql 9.2.24 and what I get is as follow:

SQLSTATE[42883]: Undefined function: 7 ERROR: function rollup(text) does not exist
 LINE 4: ...object_id GROUP BY c_os.varvalue) AS sub GROUP BY ROLLUP (os...
 ^
 HINT: No function matches the given name and argument types. You might need to add explicit type casts., query was: SELECT rollup.os, rollup.hosts_cnt, rollup.hosts_nok, rollup.hosts_unhandled_nok FROM (SELECT sub.os, SUM(hosts_cnt) AS hosts_cnt, SUM(hosts_nok) AS hosts_nok, SUM(hosts_unhandled_nok) AS hosts_unhandled_nok FROM (SELECT c_os.varvalue AS os, COUNT(*) AS hosts_cnt, SUM(CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END) AS hosts_nok, SUM(CASE WHEN hs.current_state != 0 AND hs.problem_has_been_acknowledged = 0 AND hs.scheduled_downtime_depth = 0 THEN 1 ELSE 0 END) AS hosts_unhandled_nok FROM icinga_objects AS o
 INNER JOIN icinga_hosts AS h ON o.object_id = h.host_object_id AND o.is_active = 1
 LEFT JOIN icinga_hoststatus AS hs ON hs.host_object_id = h.host_object_id
 LEFT JOIN icinga_customvariablestatus AS c_os ON c_os.varname = 'os' AND c_os.object_id = o.object_id GROUP BY c_os.varvalue) AS sub GROUP BY ROLLUP (os)) AS rollup ORDER BY (rollup.os IS NOT NULL) ASC, rollup.os ASC, (rollup.hosts_cnt IS NOT NULL) ASC, rollup.hosts_cnt ASC, (rollup.hosts_nok IS NOT NULL) ASC, rollup.hosts_nok ASC, (rollup.hosts_unhandled_nok IS NOT NULL) ASC, rollup.hosts_unhandled_nok ASC

#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query(String, Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(725): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/icingaweb2/modules/cube/library/Cube/DbCube.php(66): Zend_Db_Adapter_Abstract->fetchAll(Object(Zend_Db_Select))
#5 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(175): Icinga\Module\Cube\DbCube->fetchAll()
#6 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(290): Icinga\Module\Cube\CubeRenderer->render(Object(Icinga\Web\View))
#7 zend.view:///usr/share/icingaweb2/modules/cube/application/views/scripts/index/index.phtml(18): Icinga\Module\Cube\Cube->render(Object(Icinga\Web\View))
#8 /usr/share/php/Icinga/Web/View.php(270): include(String)
#9 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render(NULL)
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/Web.php(407): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#19 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#20 {main}

SQLSTATE[42883]: Undefined function: 7 ERROR: function rollup(text) does not exist
 LINE 4: ...object_id GROUP BY c_os.varvalue) AS sub GROUP BY ROLLUP (os...
 ^
 HINT: No function matches the given name and argument types. You might need to add explicit type casts.

#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement/Pdo.php(219): PDOStatement->execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query(String, Array)
#4 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(725): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#5 /usr/share/icingaweb2/modules/cube/library/Cube/DbCube.php(66): Zend_Db_Adapter_Abstract->fetchAll(Object(Zend_Db_Select))
#6 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(175): Icinga\Module\Cube\DbCube->fetchAll()
#7 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(290): Icinga\Module\Cube\CubeRenderer->render(Object(Icinga\Web\View))
#8 zend.view:///usr/share/icingaweb2/modules/cube/application/views/scripts/index/index.phtml(18): Icinga\Module\Cube\Cube->render(Object(Icinga\Web\View))
#9 /usr/share/php/Icinga/Web/View.php(270): include(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render(NULL)
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#16 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#17 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/Web.php(407): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#19 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#20 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#21 {main}

Show Host Status returns DB Charset Error

All databases have utf8 collation and are configured in icingaweb2 to use utf8 charset, but Show Host Status consistently throws errors similar to:

SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8', query was: SELECT so.name1 AS host_name, SUM( CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) > 0 THEN 0 ELSE 1 END ) AS unhandled_service_count FROM icinga_objects AS so
INNER JOIN icinga_services AS s ON s.service_object_id = so.object_id AND so.is_active = 1
INNER JOIN icinga_servicestatus AS ss ON ss.service_object_id = so.object_id AND ss.current_state > 0
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = s.host_object_id
INNER JOIN (SELECT ho.object_id FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_customvariablestatus AS hcv_disk_smb_hostname ON h.host_object_id = hcv_disk_smb_hostname.object_id AND hcv_disk_smb_hostname.varname = 'disk_smb_hostname' COLLATE latin1_general_ci WHERE (hcv_disk_smb_hostname.varvalue = 'u122205.your-storagebox.de') LIMIT 25) AS h ON h.object_id = s.host_object_id GROUP BY so.name1 HAVING (SUM(
CASE
WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) > 0
THEN 0
ELSE 1
END
) > 0)
#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(799): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/php/Icinga/Data/Db/DbConnection.php(316): Zend_Db_Adapter_Abstract->fetchPairs(Object(Zend_Db_Select))
#5 /usr/share/php/Icinga/Data/SimpleQuery.php(626): Icinga\Data\Db\DbConnection->fetchPairs(Object(Icinga\Module\Monitoring\Backend\Ido\Query\HostserviceproblemsummaryQuery))
#6 /usr/share/icingaweb2/modules/monitoring/application/controllers/ListController.php(113): Icinga\Data\SimpleQuery->fetchPairs()
#7 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Monitoring\Controllers\ListController->hostsAction()
#8 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('hostsAction')
#9 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#10 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#11 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#12 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#13 {main}

I have no idea where latin1_general_ci comes into play. Any ideas?

More than three dimensions won't work

Adding more than three dimensions causes the inner tiles to overflow.

Expected Behavior

It should either not be possible to add more than three dimensions or should be properly handled.

Current Behavior

Adding a fourth dimension splits the inner tiles and each further dimension also splits the tiles further. Any fourth dimension already causes the tiles to overflow.

Possible Solution

Don't allow to add more than three dimensions. Maybe use remaining facts to "drill down".

Your Environment

  • Module version (System - About): master
  • Icinga Web 2 version and modules (System - About): master

Allow filtering on default variable / objects

We were testing this module, but feeling a bit limited to the custom variables only.

Why not select all services with names that start with "disk-*" for example , or how to filter on certain states and other existing objects.

Do you guys see a use case for this as well ?

Service Support

Hello,
The cube module is already great to quickly produce dashboards !
But currently, it can only deal with host statistics. Is it planned to support the service statistics?
Regards,
Yannick

Dimension slicing by custom data field names with certain characteristics cause failures or stacktrackes

Describe the bug

With the advent of Director administrators can name custom Data Fields with a variety of characters.
Users cannot use the entire variety of custom data field names that can be created as dimensions to slice Cubes.

Several unwritten rules must be followed in v1.1.1 for a Cube slicing operation to succeed and not cause a stack trace.
The rules are:

  1. A custom data field name must start with a lower-case letter.
  2. A custom data field name cannot contain spaces.
  3. A custom data field name cannot contain any punctuation besides underscores.
  4. A custom data field name cannot contain upper-case letters.
  5. A custom data field name must be 31 characters or less.

The regex that matches a name with the characteristics is: [a-z]([a-z0-9_])*.

Several different failures or stacktraces will result based on violation of these rules:

Test Cases

All test cases begin with Reporting -> Cube -> + Add a dimension.

Test case Field name Workflow Result
F stringf Click cube name -> Click Modify Success
G string g Click cube name Failure: Got no such dimension
H string-h Click cube name -> Click Modify Success
I StringI Click cube name -> Click Modify Failure: Modify 0 hosts
J string_j Click cube name -> Click Modify Success

Result explanations

Success

Success of this test means that the Modify link was clicked and the Director Host modification form was presented.

Failure: Got no such dimension

This is an invalid error message in the test case (G), because the field does exist.
When the title of the cube is clicked, the following is given in the right panel:

Got no such dimension: "string%20g"

#0 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Controller.php(54): Icinga\Module\Cube\Cube->slice(String, String)
#1 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Cube\Web\Controller->detailsAction()
#2 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#3 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#4 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#5 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#6 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#7 {main}

Note that the error message is URL-encoded, perhaps this is why the comparsion to find the dimension failed.

Also please note that a better error message for a failed search would be "Dimension not found."

Failure: Modify 0 hosts

This is also a problem with the comparison in the search.
Apparently the string to look for in the list of dimensions is lowercased before the search.
When the title of the cube is clicked, the following is given in the right panel:

stringi = Igloodly Doodly Doo

Show hosts status         Modify 0 hosts

This shows all            This allows you to 
matching hosts and        modify properties for 
their current state in    all chosen hosts at
the monitoring module     once

Clearly the search string was lowercased before the search, since it was displayed that way.
And yet the code believes the search succeeded, because it wants to let you modify the Hosts.
But there are zero (0) of them.

If the Modify 0 hosts link is clicked:

Uncaught Error: Call to a member function hasConnection() on boolean in /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php:132
Stack trace:
#0 /usr/share/icingaweb2/modules/director/application/forms/IcingaMultiEditForm.php(28): Icinga\Module\Director\Web\Form\DirectorObjectForm->object()
#1 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectsController.php(182): Icinga\Module\Director\Forms\IcingaMultiEditForm->setObjects(Array)
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectsController.php(165): Icinga\Module\Director\Web\Controller\ObjectsController->commonForEdit()
#3 /usr/share/icingaweb2/modules/director/application/controllers/HostsController.php(37): Icinga\Module\Director\Web\Controller\ObjectsController->editAction()
#4 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\HostsController->editAction()
#5 /usr/share/php/Icinga/Web/Controller/Dispatcher.ph

#0 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}()
#1 {main}

Recent fixes

These tests were previously conducted on v1.1.0 and there were stacktraces produced for
test cases G and H.
v1.1.1 fixed test case H, and produces an invalid error message for case G.

To Reproduce

  1. In Director, add the following Data Fields of Data Type String:
  • stringf (all lowercase)
  • string g (with a space)
  • string-h (with a dash)
  • StringI (mixed case)
  • string_j (all lowercase with an underscore)
  1. In Director, create a Host Template and add all fields created above.
  2. In Director, Create a Host using that template, setting values for the fields. (The exact value is not significant.)
  3. In Director, Deploy.
  4. Use the workflows above to reproduce the test cases.

Expected behavior

All given examples should work.
All cases should present the correct list of Hosts for Director Modification.

Screenshots

Setup

Screen Shot 2020-07-15 at 8 04 48 PM

Success

Screen Shot 2020-07-15 at 8 06 18 PM
Screen Shot 2020-07-15 at 8 06 38 PM

Failure: Got no such dimension

Screen Shot 2020-07-15 at 8 07 01 PM

Failure: Failure: Modify 0 hosts

Screen Shot 2020-07-15 at 8 07 35 PM
Screen Shot 2020-07-15 at 8 07 52 PM

Your Environment

  • Icinga 2.10.5
  • Icinga Web 2.7.3
  • Director 1.7.2
  • Cube 1.1.1

Additional context

There may be additional test cases I have not thought of.

Also, based on the limitations of column naming in MySQL, MariaDB and PostgreSQL,
the maximum length of a custom data field that will succeed is 31 characters.

  • MySQL: 64
  • MariaDB: 80
  • PostgreSQL: 31

Version number not incremented in module.info for v1.1.1 release

Describe the bug

After installing Cube 1.1.1 the version number still shows as 1.1.0. The only place I can find the number is in ./module.info.

To Reproduce

  1. Install icingaweb2-module-cube v1.1.1.
  2. Enable module using icingacli module enable cube.
  3. Examine version using icingacli module list | grep cube.

Expected behavior

Expected:

cube           1.1.1     enabled   Cube for Icinga Web 2

Actual:

cube           1.1.0     enabled   Cube for Icinga Web 2

Your Environment

  • Icinga Web 2: v2.7.3
  • Cube: v1.1.1

Additional context

This is confusing for the installer because it is not clear that the new version of the module has been installed.
This could also confuse configuration management if it thinks that the module needs to be upgraded when it already has been.

Cube details are not filtered

Describe the bug

Adding a filter and clicking on a cube opens its details. Though, the action leading to the host/service list does not use the filter then.

To Reproduce

  1. Add a filter
  2. Choose a dimension
  3. Click on a cube
  4. Click "Show ... status"

Expected behavior

The resulting list is filtered not only by dimensions.

near instant crash after installing module, SQL error

Expected Behavior

After installing and enabeling the module I expect it to work.

Current Behavior

When I start using the module, it crashes as soon as I add a dimension.

Steps to Reproduce (for bugs)

  1. install module, enable.
  2. click reporting > cube
  3. Click "add dimension"
  4. I only have "os" in the drop-down.
  5. select "os"
  6. Crash
  7. error on screen:
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "WITH ROLLUP"
LINE 4: ...t_id GROUP BY c_os.varvalue) AS sub GROUP BY (os) WITH ROLLU...
^, query was: SELECT rollup.os, rollup.hosts_cnt, rollup.hosts_nok, rollup.hosts_unhandled_nok FROM (SELECT sub.os, SUM(hosts_cnt) AS hosts_cnt, SUM(hosts_nok) AS hosts_nok, SUM(hosts_unhandled_nok) AS hosts_unhandled_nok FROM (SELECT c_os.varvalue AS os, COUNT(*) AS hosts_cnt, SUM(CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END) AS hosts_nok, SUM(CASE WHEN hs.current_state != 0 AND hs.problem_has_been_acknowledged = 0 AND hs.scheduled_downtime_depth = 0 THEN 1 ELSE 0 END) AS hosts_unhandled_nok FROM icinga_objects AS o
INNER JOIN icinga_hosts AS h ON o.object_id = h.host_object_id AND o.is_active = 1
LEFT JOIN icinga_hoststatus AS hs ON hs.host_object_id = h.host_object_id
LEFT JOIN icinga_customvariablestatus AS c_os ON c_os.varname = 'os' AND c_os.object_id = o.object_id GROUP BY c_os.varvalue) AS sub GROUP BY (os) WITH ROLLUP) AS rollup ORDER BY (rollup.os IS NOT NULL) ASC, rollup.os ASC, (rollup.hosts_cnt IS NOT NULL) ASC, rollup.hosts_cnt ASC, (rollup.hosts_nok IS NOT NULL) ASC, rollup.hosts_nok ASC, (rollup.hosts_unhandled_nok IS NOT NULL) ASC, rollup.hosts_unhandled_nok ASC

#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(725): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/icingaweb2/modules/cube/library/Cube/DbCube.php(66): Zend_Db_Adapter_Abstract->fetchAll(Object(Zend_Db_Select))
#5 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(175): Icinga\Module\Cube\DbCube->fetchAll()
#6 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(290): Icinga\Module\Cube\CubeRenderer->render(Object(Icinga\Web\View))
#7 zend.view:///usr/share/icingaweb2/modules/cube/application/views/scripts/index/index.phtml(18): Icinga\Module\Cube\Cube->render(Object(Icinga\Web\View))
#8 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#9 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render('index/index.pht...')
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...', NULL)
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('indexAction')
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#19 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#20 {main}

Your Environment

  • Module version (System - About): 1.0
  • Icinga Web 2 version and modules (System - About): 2.4.1
  • Icinga 2 version (icinga2 --version): r2.7.0-1
  • Operating System and version: Debian 3.16.36-1+deb8u2
  • Webserver, PHP versions: Apache/2.4.10, PHP 5.6.30-0+deb8u1
  • Database: Postgres 9.4.12

PostgreSQL: Error in SQL syntax

Describe the bug

SQLSTATE[42803]: Grouping error: 7 ERROR: column "cv.customvariablestatus_id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT cv.varname, cv.* FROM icinga_objects AS ho
^, query was: SELECT cv.varname, cv.* FROM icinga_objects AS ho
INNER JOIN icinga_hosts AS h ON h.host_object_id = ho.object_id AND ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_customvariablestatus AS cv ON cv.object_id = ho.object_id WHERE (cv.is_json = 0) GROUP BY cv.varname ORDER BY LOWER(h.display_name) ASC
SQLSTATE[42803]: Grouping error: 7 ERROR: column "cv.customvariablestatus_id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT cv.varname, cv.* FROM icinga_objects AS ho
^

To Reproduce

Open Reporting -> Cube

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): 2.7.3
sudo icingacli module list
MODULE         VERSION   STATE     DESCRIPTION
businessprocess 2.2.0     enabled   A Business Process viewer and modeler
cube           1.1.0     enabled   Cube for Icinga Web 2
director       1.7.1     enabled   Director - Config tool for Icinga 2
doc            2.7.3     enabled   Documentation module
grafana        1.3.6     enabled   Grafana - A perfdata visualisation module
incubator      0.5.0     enabled   Incubator provides bleeding-edge libraries
ipl            v0.4.0    enabled   The Icinga PHP library
map            1.0.3     enabled   Map visualization
monitoring     2.7.3     enabled   Icinga monitoring module
reactbundle    0.7.0     enabled   ReactPHP-based 3rd party libraries
reporting      0.9.0     enabled   Reporting
translation    2.7.3     enabled   Translation module
vsphere        1.1.0     enabled   VMware vSphere Import Source
vspheredb      1.0.4     enabled   VMware vSphere DB
x509           1.0.0     enabled   Scan and view X.509 certificate usage

  • Web browser used: Chrome 72
  • Icinga 2 version used (icinga2 --version): 2.11.2-1
  • PHP version used (php --version): 7.1.30
  • Server operating system and version: CentOS Linux release 7.7.1908 (Core)

Additional context

#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(String, Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(782): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/icingaweb2/modules/cube/library/Cube/Ido/IdoHostStatusCube.php(72): Zend_Db_Adapter_Abstract->fetchCol(Object(Zend_Db_Select))
#5 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(84): Icinga\Module\Cube\Ido\IdoHostStatusCube->listAvailableDimensions()
#6 /usr/share/icingaweb2/modules/cube/application/forms/DimensionsForm.php(29): Icinga\Module\Cube\Cube->listAdditionalDimensions()
#7 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(312): Icinga\Module\Cube\Forms\DimensionsForm->setup()
#8 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(451): Icinga\Module\Cube\Web\Form\QuickForm->prepareElements()
#9 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(464): Icinga\Module\Cube\Web\Form\QuickForm->setRequest(Object(Icinga\Web\Request))
#10 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(324): Icinga\Module\Cube\Web\Form\QuickForm->getRequest()
#11 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Controller.php(101): Icinga\Module\Cube\Web\Form\QuickForm->handleRequest()
#12 /usr/share/icingaweb2/modules/cube/application/controllers/HostsController.php(15): Icinga\Module\Cube\Web\Controller->renderCube()
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Cube\Controllers\HostsController->indexAction()
#14 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#16 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#18 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#19 {main}
#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement/Pdo.php(219): PDOStatement->execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(String, Array)
#4 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(782): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#5 /usr/share/icingaweb2/modules/cube/library/Cube/Ido/IdoHostStatusCube.php(72): Zend_Db_Adapter_Abstract->fetchCol(Object(Zend_Db_Select))
#6 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(84): Icinga\Module\Cube\Ido\IdoHostStatusCube->listAvailableDimensions()
#7 /usr/share/icingaweb2/modules/cube/application/forms/DimensionsForm.php(29): Icinga\Module\Cube\Cube->listAdditionalDimensions()
#8 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(312): Icinga\Module\Cube\Forms\DimensionsForm->setup()
#9 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(451): Icinga\Module\Cube\Web\Form\QuickForm->prepareElements()
#10 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(464): Icinga\Module\Cube\Web\Form\QuickForm->setRequest(Object(Icinga\Web\Request))
#11 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Form/QuickForm.php(324): Icinga\Module\Cube\Web\Form\QuickForm->getRequest()
#12 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Controller.php(101): Icinga\Module\Cube\Web\Form\QuickForm->handleRequest()
#13 /usr/share/icingaweb2/modules/cube/application/controllers/HostsController.php(15): Icinga\Module\Cube\Web\Controller->renderCube()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Cube\Controllers\HostsController->indexAction()
#15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#19 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#20 {main}

Icinga DB Support

My basic host cube implementation can be found here. (Requires Icinga/ipl-sql#48)

The main differences compared to #64 are:

  • The CubeRenderer classes have moved to their own namespace: Icinga\Module\Cube\CubeRenderer
  • The classes DbCube and ZfSelectWrapper have moved to the namespace Icinga\Module\Cube\Ido
  • The available facts are fetched from customvar_flat instead of customvar
  • The queries are assembled by making use of ipl-orm's capabilities

Things to change:

  • I consider the class IcingaDbHostStatusCube to be final, generally. But class IcingaDbServiceStatusCube isn't implemented yet
  • The class IcingaDbCube mostly consists of the method fetchAll(). It doesn't differentiate between inner, full and rollup queries, which it should IMHO
  • Icinga\Module\Cube\IcingaDb\CustomVariableDimension::addToCube() needs to be implemented. Note my todo's in method IcingaDbCube::fetchAll()
  • A hook for action links is required, it should require to implement this method:
    /**
     * Create additional action links for the given cube
     * 
     * @param Icinga\Module\Cube\IcingaDb\IcingaDbCube $cube
     * 
     * @return ipl\Web\Widget\Link[]
     */
    createActionLinks(Icinga\Module\Cube\IcingaDb\IcingaDbCube $cube)

Host cubes displays number of services instead of number of hosts

Describe the bug

When I create a host cube and select a host variable, the slices show the number of services on the matching hosts instead of the number of hosts. This also takes a lot more time than it ought to if it was just iterating over the hosts. Also just loading the Hosts-tab in the Cube page takes quite a while. Clicking the name of the slice give a host list with just the relevant host as expected.
It seems to me that both in showing the cube and in fetching the dimension options for a cube it iterates over the service objects, using their host variables, rather than the host objects, but this is just conjecture.

To Reproduce

  1. Create a new cube
  2. Select the Hosts tab
  3. Add a dimension, custom variable or otherwise
  4. Observe that the slices show numbers of services who's host match the criteria

Expected behavior

The slices should show the number of hosts matching the criteria. For example the Darwin slice in the screenshot below should show 6, not 116, which is the total number of services on those six hosts.

Screenshots

image

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): 2.11.2
  • Web browser used: Vivaldi, Chrome & Firefox
  • Icinga 2 version used (icinga2 --version): r2.13.6-1
  • PHP version used (php --version): 8.1.2-1ubuntu2.8
  • Server operating system and version: Ubuntu 22.04.1

Sort the dimension list alphabetically

Actually the sorting of the list dimension is not sorted in a useful way
Could be very useful to have an alphabetically sorting of the dropdown menu, because it is very difficult to search some string when the number of this strings are > 100

image

Percentage support

It would be probably easy to also print the percentage of good/bad hosts/services.

Cube do not turn yellow for Warning

Cube is working as expected and is most sought for feature to provide / build necessary dashboard. Only challenge we see is if there is a Warning alert within the cube and no other - it still turns red / as if critical. This sometimes is confusing for command centers to decide the priority on which they should work. If Cube can pick up the Warning and display accordingly it will be great - like in Business Process module

Missing context in the cube title tooltip

On medium/long Object name string, it is truncated after some characters.
Please consider to create an hint on hover that will help the users to read the complete name of the object.
Actually the hint on hover is "Show more details"

It is confiured at line 300 of this file "library/Cube/CubeRenderer.php"

. '" title="' . $view->escape('Show more details') . '"'
cube-hint

Wrong state color of outer dimension

Describe the bug

When implementing sort control, I noticed that the state class of the cube dimension wrapper (outer dimension) only based on the first inner dimension.
So if the first inner dimension has the state class UP|OK, the wrapper also gets the state class UP|OK and vice versa, no matter if there are further DOWN|CRITICAL dimensions.

To Reproduce

  1. Use the sort control PR.
  2. Add two or more dimensions.
  3. Change sort order and notice the change.

Expected behavior

The outer dimension should have the correct state class.

Screenshots

The prod -> ps has berlin (DOWN) on the first place, so the outer dimension (prod) is marked as down (red).

Screenshot 2022-12-20 at 15 23 16

The prod -> ps has london (UP) on the first place, so the outer dimension (prod) is marked as UP (black).

Screenshot 2022-12-20 at 15 23 01

Array dimensions get lost when showing cube details

Describe the bug

If you have a custom var that holds an array and you choose it as dimension, clicking on a cube opens a detail that doesn't use the dimension as filter.

To Reproduce

  1. Use IcingaDB as backend
  2. Have a customvar that holds an array
  3. Choose it as dimension in either host or service cube view
  4. Click on a cube

Expected behavior

The cube shows the filter in the title and clicking on "Show ... status" opens the filtered list.

Screenshots

Working:
Screenshot from 2023-01-25 13-05-17

Broken:
Screenshot from 2023-01-25 13-04-21

Your Environment

  • Module version: master

Additional context

Works in the latest release. Broke with a recent change.

Hide passwords from services

hi,
it seems, that the module shows the passwords from custom vars. It would be great, if it respects modules/monitoring/config.ini -> protected_customvars

no postgresql support

SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "WITH"
LINE 4: ...t_id GROUP BY c_os.varvalue) AS sub GROUP BY (os) WITH ROLLU...
^, query was: SELECT rollup.os, rollup.hosts_cnt, rollup.hosts_nok, rollup.hosts_unhandled_nok FROM (SELECT sub.os, SUM(hosts_cnt) AS hosts_cnt, SUM(hosts_nok) AS hosts_nok, SUM(hosts_unhandled_nok) AS hosts_unhandled_nok FROM (SELECT c_os.varvalue AS os, COUNT(*) AS hosts_cnt, SUM(CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END) AS hosts_nok, SUM(CASE WHEN hs.current_state != 0 AND hs.problem_has_been_acknowledged = 0 AND hs.scheduled_downtime_depth = 0 THEN 1 ELSE 0 END) AS hosts_unhandled_nok FROM icinga_objects AS o
INNER JOIN icinga_hosts AS h ON o.object_id = h.host_object_id AND o.is_active = 1
LEFT JOIN icinga_hoststatus AS hs ON hs.host_object_id = h.host_object_id
LEFT JOIN icinga_customvariablestatus AS c_os ON c_os.varname = 'os' AND c_os.object_id = o.object_id GROUP BY c_os.varvalue) AS sub GROUP BY (os) WITH ROLLUP) AS rollup ORDER BY (rollup.os IS NOT NULL) ASC, rollup.os ASC, (rollup.hosts_cnt IS NOT NULL) ASC, rollup.hosts_cnt ASC, (rollup.hosts_nok IS NOT NULL) ASC, rollup.hosts_nok ASC, (rollup.hosts_unhandled_nok IS NOT NULL) ASC, rollup.hosts_unhandled_nok ASC

I might give it a try, once i figure out all the queries the module does.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.