2011-04-20 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Added _policy_ macro to alerts (Enterprise). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4269 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b4a231334f
commit
dc92bdce3c
|
@ -1,3 +1,7 @@
|
|||
2011-04-20 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/Core.pm: Added _policy_ macro to alerts (Enterprise).
|
||||
|
||||
2011-04-19 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/DB.pm,
|
||||
|
|
|
@ -639,7 +639,7 @@ sub pandora_execute_action ($$$$$$$$$;$) {
|
|||
_module_ => (defined ($module)) ? $module->{'nombre'} : '',
|
||||
_moduledescription_ => (defined ($module)) ? $module->{'descripcion'} : '',
|
||||
_id_agent_ => (defined ($module)) ? $module->{'id_agente'} : '',
|
||||
_id_alert_ => $alert->{'id'}
|
||||
_policy_ => (defined ($module)) ? enterprise_hook('get_policy_name', [$dbh, $module->{'id_policy_module'}]) : '',
|
||||
);
|
||||
|
||||
if ((defined ($extra_macros)) && (ref($extra_macros) eq "HASH")) {
|
||||
|
@ -1495,8 +1495,13 @@ sub subst_alert_macros ($$) {
|
|||
my ($string, $macros) = @_;
|
||||
|
||||
while ((my $macro, my $value) = each (%{$macros})) {
|
||||
|
||||
# Undefined macro value
|
||||
next unless defined ($value);
|
||||
|
||||
# Macro data may contain HTML entities
|
||||
my $decoded_value = decode_entities ($value);
|
||||
|
||||
$string =~ s/($macro)/$decoded_value/ig;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue