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

* lib/PandoraFMS/Core.pm: Assign default values to the _snmp_fx_ macros
	  from variable bindings.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8469 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2013-07-03 17:26:27 +00:00
parent 13c8e650ed
commit 846b4a12c2
2 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-07-03 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Assign default values to the _snmp_fx_ macros
from variable bindings.
2013-07-01 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Resolve numeric ids to strings before writing

View File

@ -2771,6 +2771,23 @@ 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++) {
my $macro_name = '_snmp_f' . $i . '_';
last if (! defined ($custom_values[$i-1]));
if ($custom_values[$i-1] =~ m/= \S+: (.*)/) {
my $value = $1;
# Strip leading and trailing double quotes
$value =~ s/^"//;
$value =~ s/"$//;
$macros{$macro_name} = $value;
}
}
# Evaluate _snmp_fx_ macros
for (my $i = 1; $i <= 6; $i++) {
my $macro_name = '_snmp_f' . $i . '_';