diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index c7208f5876..89ae55f6c1 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1399,6 +1399,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) { _timestamp_ => (defined($timestamp)) ? $timestamp : strftime ("%Y-%m-%d %H:%M:%S", localtime()), _timezone_ => strftime ("%Z", localtime()), _data_ => $data, + _dataunit_ => (defined ($module)) ? $module->{'unit'} : '', _prevdata_ => undef, _homeurl_ => $pa_config->{'public_url'}, _alert_name_ => $alert->{'name'}, @@ -4905,6 +4906,9 @@ sub on_demand_macro($$$$$$;$) { my $field_number = $1; my $field_value = get_db_value($dbh, 'SELECT description FROM tagent_custom_data WHERE id_field=? AND id_agent=?', $field_number, $agent_id); return (defined($field_value)) ? $field_value : ''; + } elsif ($macro eq '_dataunit_'){ + return '' unless defined ($module); + my $field_value = get_db_value($dbh, 'SELECT unit FROM tagente_modulo where id_agente_modulo = ? limit 1', $module->{'id_agente_modulo'}); } elsif ($macro eq '_prevdata_') { return '' unless defined ($module); if ($module->{'id_tipo_modulo'} eq 3){