Merge branch 'ent-7468-campo-plugin-falla-bandwith-politicas' into 'develop'

Fixed issue with id_plugin with bandwidth modules

Closes pandora_enterprise#7468

See merge request artica/pandorafms!4159
This commit is contained in:
Daniel Rodriguez 2021-05-28 10:38:21 +00:00
commit 2eb85562c2
1 changed files with 33 additions and 18 deletions

View File

@ -312,7 +312,7 @@ class AgentWizard extends HTML
$this->idPolicy = get_parameter('id', '');
$this->targetIp = get_parameter('targetIp', '');
if (!empty($this->idAgent)) {
if (empty($this->idAgent) === false) {
$array_aux = db_get_all_rows_sql(
sprintf(
'SELECT ip FROM taddress ta
@ -1691,6 +1691,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) {
$fieldsPlugin = json_decode($fieldsPlugin, true);
$i = 1;
@ -1715,6 +1729,7 @@ class AgentWizard extends HTML
$values['macros'] = json_encode($fieldsPlugin);
}
}
}
} else if ($this->protocol === 'wmi') {
if ($candidate['execution_type'] === EXECUTION_TYPE_NETWORK) {
// Generals fields.