diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index a06a8d04c8..4585757151 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2013-07-05 Ramon Novoa + + * lib/PandoraFMS/Core.pm: Exported subst_alert_macros. Added support + for an arbitrarily large number of _snmp_fx_ macros. + 2013-07-05 Ramon Novoa * lib/PandoraFMS/PluginServer.pm: Added agent and module macros to diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index b63fab5aa0..4c8b607269 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -196,6 +196,7 @@ our @EXPORT = qw( pandora_server_statistics pandora_self_monitoring pandora_process_policy_queue + subst_alert_macros get_agent_from_addr get_agent_from_name @ServerTypes @@ -2773,10 +2774,9 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { # Assign default values to the _snmp_fx_ macros from variable bindings my @custom_values = split ("\t", $trap_custom_oid); - for (my $i = 1; $i <= 6; $i++) { + for (my $i = 1; defined ($custom_values[$i-1]); $i++) { my $macro_name = '_snmp_f' . $i . '_'; - last if (! defined ($custom_values[$i-1])); if ($custom_values[$i-1] =~ m/= \S+: (.*)/) { my $value = $1;