From 40cd8e5c442ab51d8e73deeada5ec4b2ec634dc4 Mon Sep 17 00:00:00 2001 From: ramonn Date: Fri, 5 Jul 2013 09:56:08 +0000 Subject: [PATCH] 2013-07-05 Ramon Novoa * lib/PandoraFMS/Core.pm: Exported subst_alert_macros. Added support for an arbitrarily large number of _snmp_fx_ macros. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8481 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Core.pm | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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;