mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
IDO: Add config option to use the customvariables table for fetching custom vars
Icinga 1.x has the option to not dump the icinga_customvariablestatus table: dump_customvar_status=0 With this setting applied, Web 2 will never show custom variables because Web 2 relies on the customvariablestatus table. This commit introduces a config option to use the customvariables table instead: /etc/icingaweb2/modules/monitoring/config.ini [ido] use_customvar_status_table = 0
This commit is contained in:
parent
65d7c18c31
commit
1ed2ebc191
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
||||||
|
|
||||||
|
use Icinga\Application\Config;
|
||||||
|
|
||||||
class CustomvarQuery extends IdoQuery
|
class CustomvarQuery extends IdoQuery
|
||||||
{
|
{
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
@ -44,8 +46,14 @@ class CustomvarQuery extends IdoQuery
|
|||||||
$this->columnMap['customvariablestatus']['is_json'] = '(0)';
|
$this->columnMap['customvariablestatus']['is_json'] = '(0)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! (bool) Config::module('monitoring')->get('ido', 'use_customvar_status_table', true)) {
|
||||||
|
$table = 'customvariables';
|
||||||
|
} else {
|
||||||
|
$table = 'customvariablestatus';
|
||||||
|
}
|
||||||
|
|
||||||
$this->select->from(
|
$this->select->from(
|
||||||
array('cvs' => $this->prefix . 'customvariablestatus'),
|
array('cvs' => $this->prefix . $table),
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('cvo' => $this->prefix . 'objects'),
|
array('cvo' => $this->prefix . 'objects'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user