+3
Under review
Tomás Abad 4 months ago • updated by fusioninventory 3 months ago 2

   With FusionInventory Agent v2.3.20 (and probably previous versions) it isn't possible to know the order in which the tasks of agent will be executed, basically because there isn't a prearranged tasks execution plan. Each time FusionInventory Agent (FIA) is executed it builds a different Planned tasks as it easily verifiable.


C:\>"%ProgramFiles%\FusionInventory-Agent\fusioninventory-agent.bat" --version
FusionInventory Agent (2.3.20)
Provided by Teclib
Installer built with Appveyor on Fri Jun  2 06:15:46 UTC 2017
C:\>"%ProgramFiles%\FusionInventory-Agent\fusioninventory-agent.bat" --config none --debug --local "%SystemRoot%\Temp" --force --logger File --logfile "%SystemRoot%\Temp\fusioninventory-agent-exec_1.log"
C:\>"%ProgramFiles%\FusionInventory-Agent\fusioninventory-agent.bat" --config none --debug --local "%SystemRoot%\Temp" --force --logger File --logfile "%SystemRoot%\Temp\fusioninventory-agent-exec_2.log"
C:\>"%ProgramFiles%\FusionInventory-Agent\fusioninventory-agent.bat" --config none --debug --local "%SystemRoot%\Temp" --force --logger File --logfile "%SystemRoot%\Temp\fusioninventory-agent-exec_3.log"
C:\>type "%SystemRoot%\Temp\fusioninventory-agent-exec_1.log"
[Mon Jul 10 12:52:22 2017][debug] FusionInventory Agent (2.3.20)
[Mon Jul 10 12:52:22 2017][debug] Configuration directory: C:\Archivos de programa\FusionInventory-Agent/etc
[Mon Jul 10 12:52:22 2017][debug] Data directory: C:\Archivos de programa\FusionInventory-Agent/share
[Mon Jul 10 12:52:22 2017][debug] Storage directory: C:\Archivos de programa\FusionInventory-Agent/var
[Mon Jul 10 12:52:22 2017][debug] Lib directory: C:\Archivos de programa\FusionInventory-Agent/perl/agent
[Mon Jul 10 12:52:22 2017][debug] [target local0] Next server contact planned for Mon Jul 10 13:30:32 2017
[Mon Jul 10 12:52:22 2017][debug] Available tasks:
[Mon Jul 10 12:52:22 2017][debug] - WakeOnLan: 2.2
[Mon Jul 10 12:52:22 2017][debug] - NetInventory: 2.2.2
[Mon Jul 10 12:52:22 2017][debug] - Inventory: 1.2
[Mon Jul 10 12:52:22 2017][debug] - NetDiscovery: 2.2.2
[Mon Jul 10 12:52:22 2017][debug] - ESX: 2.2.2
[Mon Jul 10 12:52:22 2017][debug] - Deploy: 2.3
[Mon Jul 10 12:52:22 2017][debug] - Collect: 2.4.0
[Mon Jul 10 12:52:22 2017][debug] Planned tasks:        <----------(*)
[Mon Jul 10 12:52:22 2017][debug] - WakeOnLan: 2.2
[Mon Jul 10 12:52:22 2017][debug] - NetInventory: 2.2.2
[Mon Jul 10 12:52:22 2017][debug] - Inventory: 1.2
[Mon Jul 10 12:52:22 2017][debug] - NetDiscovery: 2.2.2
[Mon Jul 10 12:52:22 2017][debug] - ESX: 2.2.2
[Mon Jul 10 12:52:22 2017][debug] - Deploy: 2.3
[Mon Jul 10 12:52:22 2017][debug] - Collect: 2.4.0
[Mon Jul 10 12:52:22 2017][info] Provided by Teclib
[Mon Jul 10 12:52:22 2017][info] Installer built with Appveyor on Fri Jun  2 06:15:46 UTC 2017
[...]
C:\>type "%SystemRoot%\Temp\fusioninventory-agent-exec_2.log"
[Mon Jul 10 12:56:21 2017][debug] FusionInventory Agent (2.3.20)
[Mon Jul 10 12:56:21 2017][debug] Configuration directory: C:\Archivos de programa\FusionInventory-Agent/etc
[Mon Jul 10 12:56:21 2017][debug] Data directory: C:\Archivos de programa\FusionInventory-Agent/share
[Mon Jul 10 12:56:21 2017][debug] Storage directory: C:\Archivos de programa\FusionInventory-Agent/var
[Mon Jul 10 12:56:21 2017][debug] Lib directory: C:\Archivos de programa\FusionInventory-Agent/perl/agent
[Mon Jul 10 12:56:21 2017][debug] [target local0] Next server contact planned for Mon Jul 10 13:28:14 2017
[Mon Jul 10 12:56:21 2017][debug] Available tasks:
[Mon Jul 10 12:56:21 2017][debug] - Deploy: 2.3
[Mon Jul 10 12:56:21 2017][debug] - ESX: 2.2.2
[Mon Jul 10 12:56:21 2017][debug] - Collect: 2.4.0
[Mon Jul 10 12:56:21 2017][debug] - WakeOnLan: 2.2
[Mon Jul 10 12:56:21 2017][debug] - NetDiscovery: 2.2.2
[Mon Jul 10 12:56:21 2017][debug] - NetInventory: 2.2.2
[Mon Jul 10 12:56:21 2017][debug] - Inventory: 1.2
[Mon Jul 10 12:56:21 2017][debug] Planned tasks:        <----------(*)
[Mon Jul 10 12:56:21 2017][debug] - Deploy: 2.3
[Mon Jul 10 12:56:21 2017][debug] - ESX: 2.2.2
[Mon Jul 10 12:56:21 2017][debug] - Collect: 2.4.0
[Mon Jul 10 12:56:21 2017][debug] - WakeOnLan: 2.2
[Mon Jul 10 12:56:21 2017][debug] - NetDiscovery: 2.2.2
[Mon Jul 10 12:56:21 2017][debug] - NetInventory: 2.2.2
[Mon Jul 10 12:56:21 2017][debug] - Inventory: 1.2
[Mon Jul 10 12:56:21 2017][info] Provided by Teclib
[Mon Jul 10 12:56:21 2017][info] Installer built with Appveyor on Fri Jun  2 06:15:46 UTC 2017
[...]
C:\>type "%SystemRoot%\Temp\fusioninventory-agent-exec_3.log"
[Mon Jul 10 12:58:02 2017][debug] FusionInventory Agent (2.3.20)
[Mon Jul 10 12:58:02 2017][debug] Configuration directory: C:\Archivos de programa\FusionInventory-Agent/etc
[Mon Jul 10 12:58:02 2017][debug] Data directory: C:\Archivos de programa\FusionInventory-Agent/share
[Mon Jul 10 12:58:02 2017][debug] Storage directory: C:\Archivos de programa\FusionInventory-Agent/var
[Mon Jul 10 12:58:02 2017][debug] Lib directory: C:\Archivos de programa\FusionInventory-Agent/perl/agent
[Mon Jul 10 12:58:02 2017][debug] [target local0] Next server contact planned for Mon Jul 10 13:37:23 2017
[Mon Jul 10 12:58:02 2017][debug] Available tasks:
[Mon Jul 10 12:58:02 2017][debug] - NetDiscovery: 2.2.2
[Mon Jul 10 12:58:02 2017][debug] - WakeOnLan: 2.2
[Mon Jul 10 12:58:02 2017][debug] - Inventory: 1.2
[Mon Jul 10 12:58:02 2017][debug] - ESX: 2.2.2
[Mon Jul 10 12:58:02 2017][debug] - Deploy: 2.3
[Mon Jul 10 12:58:02 2017][debug] - NetInventory: 2.2.2
[Mon Jul 10 12:58:02 2017][debug] - Collect: 2.4.0
[Mon Jul 10 12:58:02 2017][debug] Planned tasks:        <----------(*)
[Mon Jul 10 12:58:02 2017][debug] - NetDiscovery: 2.2.2
[Mon Jul 10 12:58:02 2017][debug] - WakeOnLan: 2.2
[Mon Jul 10 12:58:02 2017][debug] - Inventory: 1.2
[Mon Jul 10 12:58:02 2017][debug] - ESX: 2.2.2
[Mon Jul 10 12:58:02 2017][debug] - Deploy: 2.3
[Mon Jul 10 12:58:02 2017][debug] - NetInventory: 2.2.2
[Mon Jul 10 12:58:02 2017][debug] - Collect: 2.4.0
[Mon Jul 10 12:58:02 2017][info] Provided by Teclib
[Mon Jul 10 12:58:02 2017][info] Installer built with Appveyor on Fri Jun  2 06:15:46 UTC 2017
[...]

   This behaviour isn't an error in itself but it has got, or may to have, annoying side effects.


   The first one is that analyse the log file of FIA may be a chaotic task because that what you are looking for is before or after something most of the time, but rarely where you expect it.


   The second one is regarding FusionInventory for GLPI (FI4G) and is that a task of FI4G may have a strange behaviour depending of order the tasks of FIA are executed. For example, assuming that the elements of Network_A aren't in GLPI, a FI4G Network_A task with two jobs, Inventory_Network_A (NetInventory Module) and Discovery_Network_A (NetDiscovery Module), may make that GLPI have only knowledge of elements of Network_A (whether FIA NetInventory task is executed before NetDiscovery task) or that it have knowledge of elements of Network_A and their data (whether FIA NetInventory task is executed after NetDiscovery task) after the first execution of FI4G Network_A task.


   This second side effect could be corrected with the use of --tasks option but only whether all tasks are included; if '...' (three dots) are used with --tasks option, it's not possible to know the order of those tasks that aren't explicitly included.


   So, it could be good prearranged a tasks execution. This is my proposal.


  1. Inventory
  2. Collect
  3. Deploy
  4. WakeOnLan
  5. NetDiscovery
  6. NetInventory
  7. ESX

   First, all the tasks regarding local machine then the rest of tasks, always launching NetDiscovery before NetInventory.


   With --tasks=inventory,deploy,inventory,... the Planned tasks would be:



  1. Inventory
  2. Deploy
  3. Inventory
  4. Collect
  5. WakeOnLan
  6. NetDiscovery
  7. NetInventory
  8. ESX

Best regards.

+1

I prefer have inventory after deploy (better in case deploy a new software).

If I remember, the order is not defined now so it run like agent want

+1
Under review

In my point of view, just use --tasks option, it is there for your purpose.


The not ordered execution plan is actually more a feature and this should be almost more true in future 2.4 release as each task will be able to be started at different frequency.


Regarding journal content control, supporting an option to just tag each line to the related task could help. Eventually, we can also think to define a logger by task so you can imagine to log task journal in different files.


g-bougard