From 591f6410a94531b5e07ee2b00700a3b7147a1ef7 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 28 May 2014 14:54:02 +0000 Subject: [PATCH] 2014-05-28 Sergio Martin * lib/PandoraFMS/ReconServer.pm: Fixed wrong order in recon script parameters in the conversion from json format git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10029 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/ReconServer.pm | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 62c4413a30..a92e021061 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2014-05-28 Sergio Martin + + * lib/PandoraFMS/ReconServer.pm: Fixed wrong order in + recon script parameters in the conversion from json format + 2014-05-28 Ramon Novoa * bin/pandora_server, diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index 403bdd0751..8ef3f07dc3 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -495,7 +495,16 @@ sub exec_recon_script ($$$) { # Add module macros as parameter if(ref($decoded_macros) eq "HASH") { + # Convert the hash to a sorted array + my @sorted_macros; while (my ($i, $m) = each (%{$decoded_macros})) { + $sorted_macros[$i] = $m; + } + + # Remove the 0 position + shift @sorted_macros; + + foreach my $m (@sorted_macros) { $macros_parameters = $macros_parameters . ' "' . $m->{"value"} . '"'; } }