Merge branch 'ent-9932-errores-en-consola-del-navegador-de-filtro-del-snmp-browser' into 'develop'

Fi browser console reporting errors

See merge request artica/pandorafms!5330
This commit is contained in:
Rafael Ameijeiras 2022-12-23 07:43:21 +00:00
commit c25ad3d4ea
3 changed files with 11 additions and 10 deletions

View File

@ -2100,7 +2100,7 @@ function get_snmpwalk(
}
if (enterprise_installed()) {
if ($server_to_exec != 0) {
if (empty($server_to_exec) === false) {
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
if (empty($server_data['port'])) {

View File

@ -460,7 +460,7 @@ function snmp_browser_get_oid(
$snmptranslate_bin = $config['snmptranslate'];
}
if ($server_to_exec != 0 && enterprise_installed()) {
if (empty($server_to_exec) === false && enterprise_installed()) {
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
$command_output = $snmptranslate_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Td '.escapeshellarg($oid);

View File

@ -252,9 +252,7 @@ function snmp_show_result_message(data) {
// Stop waiting modal.
waiting_modal(stop);
var dato = data.replace(/[^]+(?=\[)/, "");
dato = JSON.parse(dato);
var dato = JSON.parse(data);
if (dato.length !== 0) {
$("#error_text").text("");
@ -678,13 +676,16 @@ function show_add_module() {
//Submit form to agent module url.
$("#snmp_create_module").attr(
"action",
"index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente="+id_agent+"&tab=module&edit_module=1");
"index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente="
+id_agent+
"&tab=module&edit_module=1"
);
$('#snmp_create_module').submit();
//Close dialog.
$('#dialog_create_module').dialog("close");
},
onDeny: function () {
$("#dialog_create_module").dialog("close");
return false;
}
});
}