IcingaService: handle use_agent=n by explicitly...
...rendering command_endpoint = null fixes #921 fixes #1013
This commit is contained in:
parent
e05c3a8556
commit
5450a00c78
|
@ -125,7 +125,7 @@ class IcingaHost extends IcingaObject
|
|||
|
||||
$hostVars = array();
|
||||
|
||||
if ($connection !== null) {
|
||||
if ($connection instanceof Db) {
|
||||
foreach ($connection->fetchDistinctHostVars() as $var) {
|
||||
if ($filter->match(PropertiesFilter::$CUSTOM_PROPERTY, $var->varname, $var)) {
|
||||
if ($var->datatype) {
|
||||
|
|
|
@ -346,13 +346,13 @@ class IcingaService extends IcingaObject
|
|||
return $output;
|
||||
}
|
||||
|
||||
// In case use_agent isn't defined, do nothing
|
||||
// TODO: what if we inherit use_agent and override it with 'n'?
|
||||
if ($this->use_agent !== 'y') {
|
||||
if ($this->use_agent === 'y') {
|
||||
return $output . c::renderKeyValue('command_endpoint', 'host_name');
|
||||
} elseif ($this->use_agent === 'n') {
|
||||
return $output . c::renderKeyValue('command_endpoint', c::renderPhpValue(null));
|
||||
} else {
|
||||
return $output;
|
||||
}
|
||||
|
||||
return $output . c::renderKeyValue('command_endpoint', 'host_name');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue