Merge branch 'ent-7559-11881-limitacion-en-macro-_snmp_fx_' into 'develop'

Ent 7559 11881 limitacion en macro  snmp fx

See merge request artica/pandorafms!4203
This commit is contained in:
Daniel Rodriguez 2021-06-23 15:29:02 +00:00
commit be8318dc9b
1 changed files with 4 additions and 3 deletions

View File

@ -3961,9 +3961,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
for ($count = 1; defined ($custom_values[$count-1]); $count++) { for ($count = 1; defined ($custom_values[$count-1]); $count++) {
my $macro_name = '_snmp_f' . $count . '_'; my $macro_name = '_snmp_f' . $count . '_';
my $order_field = $alert->{'order_'.$count}; my $order_field = $alert->{'order_'.$count};
#~ my $order_field = $order_field - 1; if ($custom_values[$count] =~ m/= \S+: (.*)/) {
if ($custom_values[($order_field-1)] =~ m/= \S+: (.*)/) {
my $value = $1; my $value = $1;
# Strip leading and trailing double quotes # Strip leading and trailing double quotes
@ -3971,6 +3969,9 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
$value =~ s/"$//; $value =~ s/"$//;
$macros{$macro_name} = $value; $macros{$macro_name} = $value;
} else {
# Empty variable.
$macros{$macro_name} = '';
} }
} }
$count--; $count--;