[Fusioninventory-devel] The task/target model issue

Gonéri Le Bouder goneri at rulezlan.org
Tue Oct 12 21:59:08 UTC 2010


On Tue, Oct 12, 2010 at 12:15:39AM +0200, Guillaume Rousse wrote:
> Hello list.
> 
> Here's the issue I had when reviewing David's SNMPquery module: it uses
> a different interpretation of the configuration options passed to the agent.
> 
> The current model implemented and documented in the agent is the
> following one:
> For each given target (through server, local or stdout options),
> performs all available tasks independently, and manage each task result
> according to the target type (send it to a server, write in in a local
> file, or displays it on stdout, respectively).
> 
> ./agent --server A --server B --local /tmp --stdout
Actually it's:
  ./agent --server A,B --local /tmp --stdout

> will then run all available tasks 4 times from scratch. With regards to
> the standard inventory task, you'll run 4 different inventories.
> 
> The behaviour implemented in David task is different:
> If my target is something else as a server, abort immediatly. Otherwise,
> send my result to the server, and also write it in a local file if a
> local target has also been given, even if not the current target.
> 
> ./agent --server A --server B --local /tmp --stdout
> 
> Regarding the snmp inventory task only, it will be executed two times,
> each of them being sent to the server AND written locally.
> 
> In the first model, --local is a full-class target. In the second model,
> --local is a modifier for another target. Even if it is indeed useful
> (local SNMP result is nice too), I don't like this semantic difference
> very much. We should either find another execution model to accomodate
> this need (such as passing target-specific modifiers in a generic way),
> or revert to the currently documented model (stric target separation).
I agree. I think the main problem here are the command line parameter
limits. We can simplify the situation a lof if we decide to drop those
parameters and use instead configuration file only:

(pseudo shell):
$ ls /etc/fusioninventory/targets/
local
server1
server2
$
$
$ cat local
name=My local target
enable=true
type=Local
maxOffset=3600
task=Inventory
$
$ cat server1
name=Corporate server
enable=true
maxOffset=36000
type=Server
url=http://server1.corp/ocsinventory
user=foo
password=bar
task=Inventory,SNMPQuery,NetDiscovery
$
$ cat server2
name=My own server
enable=true
maxOffset=600
type=Server
url=http://localhost/myserver
task=Inventory
$ fusioninventory-agent --targets=local,server1
Only process local and server1 targets.
$ fusioninventory-agent --daemon
process all the target


Best regards,

    Gonéri Le Bouder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/fusioninventory-devel/attachments/20101012/7480455a/attachment.pgp>


More information about the Fusioninventory-devel mailing list