diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index d20556ba8d..f9636a12d3 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1222,8 +1222,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Check for _module_graph_Xh_ macros # Check for _module_graph_Xh_ macros and _module_graphth_Xh_ my $module_graph_list = {}; - my $macro_regexp = "_modulegraph_24h_"; - my $macro_regexp2 = "_modulegraphth_24h_"; + my $macro_regexp = "_modulegraph_(\\d+)h_"; + my $macro_regexp2 = "_modulegraphth_(\\d+)h_"; + # API connection my $ua = new LWP::UserAgent; eval { @@ -1259,12 +1260,11 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $params->{"other_mode"} = 'url_encode_separator_%7C'; - + if (! exists($module_graph_list->{$cid}) && defined $url) { - # Get the module graph image in base 64 my $response = $ua->post($url, $params); - + if ($response->is_success) { $module_graph_list->{$cid} = $response->decoded_content(); @@ -6075,5 +6075,4 @@ L, L, L, L, L, L