diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 3ee1815e08..89ea57a8a8 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2104,7 +2104,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'])) { diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index cbf812d2bd..b97f6cc313 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -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); diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 35878370da..d7b710c7c5 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -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("");