Fixed issue with id_plugin with bandwidth modules
This commit is contained in:
parent
44656b9d65
commit
91e870edbc
|
@ -312,7 +312,7 @@ class AgentWizard extends HTML
|
||||||
$this->idPolicy = get_parameter('id', '');
|
$this->idPolicy = get_parameter('id', '');
|
||||||
$this->targetIp = get_parameter('targetIp', '');
|
$this->targetIp = get_parameter('targetIp', '');
|
||||||
|
|
||||||
if (!empty($this->idAgent)) {
|
if (empty($this->idAgent) === false) {
|
||||||
$array_aux = db_get_all_rows_sql(
|
$array_aux = db_get_all_rows_sql(
|
||||||
sprintf(
|
sprintf(
|
||||||
'SELECT ip FROM taddress ta
|
'SELECT ip FROM taddress ta
|
||||||
|
@ -1687,6 +1687,20 @@ class AgentWizard extends HTML
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($this->wizardSection === 'snmp_interfaces_explorer'
|
||||||
|
&& empty($candidate['macros']) === false
|
||||||
|
) {
|
||||||
|
// Use definition provided.
|
||||||
|
$values['id_plugin'] = $candidate['id_plugin'];
|
||||||
|
$values['macros'] = base64_decode($candidate['macros']);
|
||||||
|
} else {
|
||||||
|
$fieldsPlugin = db_get_value_sql(
|
||||||
|
sprintf(
|
||||||
|
'SELECT macros FROM tplugin WHERE id=%d',
|
||||||
|
(int) $infoMacros['server_plugin']
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if ($fieldsPlugin !== false) {
|
if ($fieldsPlugin !== false) {
|
||||||
$fieldsPlugin = json_decode($fieldsPlugin, true);
|
$fieldsPlugin = json_decode($fieldsPlugin, true);
|
||||||
$i = 1;
|
$i = 1;
|
||||||
|
@ -1711,6 +1725,7 @@ class AgentWizard extends HTML
|
||||||
$values['macros'] = json_encode($fieldsPlugin);
|
$values['macros'] = json_encode($fieldsPlugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if ($this->protocol === 'wmi') {
|
} else if ($this->protocol === 'wmi') {
|
||||||
if ($candidate['execution_type'] === EXECUTION_TYPE_NETWORK) {
|
if ($candidate['execution_type'] === EXECUTION_TYPE_NETWORK) {
|
||||||
// Generals fields.
|
// Generals fields.
|
||||||
|
|
Loading…
Reference in New Issue