Fix js snmp browser errors

This commit is contained in:
Calvo 2022-12-22 20:10:02 +01:00
parent ad39ca397e
commit 617c044a92
3 changed files with 3 additions and 5 deletions

View File

@ -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'])) {

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("");