Icingaweb2: Not able to filter permissions by host custom variables

Created on 7 Dec 2017  路  7Comments  路  Source: Icinga/icingaweb2


Hi,
we updated Icingaweb2 from 2.4.2 to 2.5, since then we aren't able to filter the permissions by custom variable.

We use filters like this:

[LIN]
groups = "LIN"
permissions = "application/share/navigation, module/businessprocess, module/doc, module/graphite, module/monitoring, monitoring/command/, monitoring/command/schedule-check,
monitoring/command/acknowledge-problem, monitoring/command/remove-acknowledgement, monitoring/command/comment/
, monitoring/command/comment/add, monitoring/command/comment/delete, monitoring/command/downtime/,
monitoring/command/downtime/schedule, monitoring/command/downtime/delete, monitoring/command/process-check-result, monitoring/command/feature/instance, monitoring/command/feature/object/
,
monitoring/command/feature/object/active-checks, monitoring/command/feature/object/passive-checks, monitoring/command/feature/object/notifications, monitoring/command/feature/object/event-handler,
monitoring/command/feature/object/flap-detection, module/pnp, module/translation"
monitoring/filter/objects = "_host_team=LINUX"

Where the groups are in LDAP and _host_team is an array in a custom variable like
vars.host_Team = [ "LINUX", "WINDOWS" ]

If I use a normal variable like host_name it works.

First we got this error, but now Icingaweb2 is just empty as if the monitoring plugin is disabled:

/var/log/messages:Dec 6 13:54:10 server1 icingaweb2[27715]: Icinga\Exception\ProgrammingError in /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php:882 with message: Cannot join "hosts", no such table found #0 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(839): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->joinVirtualTable('hosts') #1 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(963): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->requireVirtualTable('hosts') #2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(939): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->joinCustomvar('_host_team') #3 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(802): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->requireCustomvar('_host_team') #4 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(504): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->requireColumn('_host_team') #5 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(524): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->requireFilterColumns(Object(Icinga\Data\Filter\FilterMatch)) #6 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(524): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->requireFilterColumns(Object(Icinga\Data\Filter\FilterOr)) #7 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(535): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->requireFilterColumns(Object(Icinga\Data\Filter\FilterAnd)) #8 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/DataView/DataView.php(493): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->addFilter(Object(Icinga\Data\Filter\FilterAnd)) #9 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/DataView/DataView.php(432): Icinga\Module\Monitoring\DataView\DataView->addFilter(Object(Icinga\Data\Filter\FilterAnd)) #10 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Object/MonitoredObject.php(658): Icinga\Module\Monitoring\DataView\DataView->applyFilter(Object(Icinga\Data\Filter\FilterAnd)) #11 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Object/MonitoredObject.php(773): Icinga\Module\Monitoring\Object\MonitoredObject->fetchServicegroups() #12 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(61): Icinga\Module\Monitoring\Object\MonitoredObject->populate() #13 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(66): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->showAction() #14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Monitoring\Controllers\ServiceController->showAction() #15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('showAction') #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('/usr/share/php/...') #20 {main}

Now we can't find some logs about this. The log level in config.ini is set to DEBUG.

Your Environment

  • Icinga Web 2 version and modules (System - About):
  • Version used (icinga2 --version): icinga2 - The Icinga 2 network monitoring daemon (version: r2.8.0-1)
  • Operating System and version: CentOS 7
  • Enabled features (icinga2 feature list): Disabled features: compatlog debuglog elasticsearch gelf influxdb livestatus opentsdb perfdata statusdata syslog
    Enabled features: api checker command graphite ido-mysql mainlog notification
  • Config validation (icinga2 daemon -C):
    [root@server1 icingaweb2]# icinga2 daemon -C
    information/cli: Icinga application loader (version: r2.8.0-1)
    information/cli: Loading configuration file(s).
    information/ConfigItem: Committing config item(s).
    warning/ApiListener: Attribute 'key_path' for object 'api' of type 'ApiListener' is deprecated and should not be used.
    warning/ApiListener: Attribute 'ca_path' for object 'api' of type 'ApiListener' is deprecated and should not be used.
    warning/ApiListener: Attribute 'cert_path' for object 'api' of type 'ApiListener' is deprecated and should not be used.
    warning/ApiListener: Please read the upgrading documentation for v2.8: https://www.icinga.com/docs/icinga2/latest/doc/16-upgrading-icinga-2/
    information/ApiListener: My API identity: server1
    warning/ApplyRule: Apply rule 'mail-icingaadmin' (in /etc/icinga2/conf.d/notifications.conf: 11:1-11:45) for type 'Notification' does not match anywhere!
    warning/ApplyRule: Apply rule 'mail-icingaadmin' (in /etc/icinga2/conf.d/notifications.conf: 23:1-23:48) for type 'Notification' does not match anywhere!
    information/ConfigItem: Instantiated 1 ApiListener.
    information/ConfigItem: Instantiated 2 Zones.
    information/ConfigItem: Instantiated 2 Endpoints.
    information/ConfigItem: Instantiated 3 ApiUsers.
    information/ConfigItem: Instantiated 1 FileLogger.
    information/ConfigItem: Instantiated 21 UserGroups.
    information/ConfigItem: Instantiated 7 NotificationCommands.
    information/ConfigItem: Instantiated 10197 Notifications.
    information/ConfigItem: Instantiated 205 CheckCommands.
    information/ConfigItem: Instantiated 1 IcingaApplication.
    information/ConfigItem: Instantiated 1034 Hosts.
    information/ConfigItem: Instantiated 58 HostGroups.
    information/ConfigItem: Instantiated 2 Downtimes.
    information/ConfigItem: Instantiated 17 TimePeriods.
    information/ConfigItem: Instantiated 34 Users.
    information/ConfigItem: Instantiated 51 Comments.
    information/ConfigItem: Instantiated 17 ServiceGroups.
    information/ConfigItem: Instantiated 8621 Services.
    information/ConfigItem: Instantiated 1 CheckerComponent.
    information/ConfigItem: Instantiated 1 ExternalCommandListener.
    information/ConfigItem: Instantiated 2 GraphiteWriters.
    information/ConfigItem: Instantiated 1 IdoMysqlConnection.
    information/ConfigItem: Instantiated 1 NotificationComponent.
    information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
    information/cli: Finished validating the configuration file(s).
bug

Most helpful comment

@lippserd
I just tested the PR https://github.com/Icinga/icingaweb2/pull/3220/files and it works like charm. Thanks for the fast fix!

And if I could "vote", I'd vote for an immediate bugfix release.

All 7 comments

Sounds like this discussion on the forums: https://monitoring-portal.org/index.php?thread/42549-detailed-view-of-serviceproblem-cannot-join-hosts-no-such-table-found/

Thanks for your reply Michael. We just found a solution. It looks like a problem with case-sensitive. The variable was created with the Icinga Director and is called vars.Team.
In Icingaweb2 we tested _host_team AND _host_Team, both didn't work.
Now we created the variable vars.teams and _host_teams works with Icingaweb2.

We will test this behaviour with some other cases. Maybe it will also help you for the debugging.

Hi,

Thanks for the report. Any chance to test the related pull request? The case sensitivity should not be related to this issue. If you filter by host custom variables, the service groups view and service detail view should lead to the error Cannot join "hosts", no such table found.

Best regards,
Eric

@lippserd
I just tested the PR https://github.com/Icinga/icingaweb2/pull/3220/files and it works like charm. Thanks for the fast fix!

And if I could "vote", I'd vote for an immediate bugfix release.

Positive feedback for PR#3220

Fixed. Thank you.

@jschoone Wait a moment, the PR is not yet merged. Thanks for the feedback guys.

Was this page helpful?
0 / 5 - 0 ratings