mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +02:00
parent
2ce84baa70
commit
7dd2ac6b83
@ -632,6 +632,25 @@ class Db extends DbConnection
|
||||
return $this->db()->fetchAll($select);
|
||||
}
|
||||
|
||||
public function fetchDistinctServiceVars()
|
||||
{
|
||||
$select = $this->db()->select()->distinct()->from(
|
||||
array('sv' => 'icinga_service_var'),
|
||||
array(
|
||||
'varname' => 'sv.varname',
|
||||
'format' => 'sv.format',
|
||||
'caption' => 'df.caption',
|
||||
'datatype' => 'df.datatype'
|
||||
)
|
||||
)->joinLeft(
|
||||
array('df' => 'director_datafield'),
|
||||
'df.varname = sv.varname',
|
||||
array()
|
||||
)->order('varname');
|
||||
|
||||
return $this->db()->fetchAll($select);
|
||||
}
|
||||
|
||||
public function dbHexFunc($column)
|
||||
{
|
||||
if ($this->isPgsql()) {
|
||||
|
@ -435,7 +435,7 @@ class IcingaService extends IcingaObject
|
||||
$serviceVars = array();
|
||||
|
||||
if ($connection !== null) {
|
||||
foreach ($connection->fetchDistinctHostVars() as $var) {
|
||||
foreach ($connection->fetchDistinctServiceVars() as $var) {
|
||||
if ($filter->match(PropertiesFilter::$CUSTOM_PROPERTY, $var->varname, $var)) {
|
||||
if ($var->datatype) {
|
||||
$serviceVars[$prefix . 'vars.' . $var->varname] = sprintf(
|
||||
|
Loading…
x
Reference in New Issue
Block a user