From f3272eb3dfca58b216f57841c41c998c4e017f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= Date: Thu, 5 May 2022 17:36:07 +0200 Subject: [PATCH] Applied fix for snmp --- pandora_console/include/class/AgentWizard.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index bc34fa5258..df9299078f 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -3572,7 +3572,12 @@ class AgentWizard extends HTML if ($full_output === true) { $output[] = $key.' = '.$oid_unit; } else { - preg_match('/\.\d+$/', $key, $index); + $index = []; + $index[] = preg_replace('/^'.$oid.'/', '', $key); + if (empty($index) === true) { + preg_match('/\.\d+$/', $key, $index); + } + $tmp = explode(': ', $oid_unit); $output[$index[0]] = str_replace('"', '', ($tmp[1] ?? '')); }