2013-07-05 Ramon Novoa <rnovoa@artica.es>

* 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
This commit is contained in:
Ramon Novoa 2013-07-05 09:56:08 +00:00
parent cf2afde6fd
commit a2e554f5dd
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2013-07-05 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Exported subst_alert_macros. Added support
for an arbitrarily large number of _snmp_fx_ macros.
2013-07-05 Ramon Novoa <rnovoa@artica.es> 2013-07-05 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/PluginServer.pm: Added agent and module macros to * lib/PandoraFMS/PluginServer.pm: Added agent and module macros to

View File

@ -196,6 +196,7 @@ our @EXPORT = qw(
pandora_server_statistics pandora_server_statistics
pandora_self_monitoring pandora_self_monitoring
pandora_process_policy_queue pandora_process_policy_queue
subst_alert_macros
get_agent_from_addr get_agent_from_addr
get_agent_from_name get_agent_from_name
@ServerTypes @ServerTypes
@ -2773,10 +2774,9 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
# Assign default values to the _snmp_fx_ macros from variable bindings # Assign default values to the _snmp_fx_ macros from variable bindings
my @custom_values = split ("\t", $trap_custom_oid); 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 . '_'; my $macro_name = '_snmp_f' . $i . '_';
last if (! defined ($custom_values[$i-1]));
if ($custom_values[$i-1] =~ m/= \S+: (.*)/) { if ($custom_values[$i-1] =~ m/= \S+: (.*)/) {
my $value = $1; my $value = $1;