[Fusioninventory-user] Working with SNMP...

Guillaume Rousse guillomovitch at gmail.com
Tue Oct 28 13:51:50 UTC 2014


Le 28/10/2014 11:20, Marco Gaiarin a écrit :
> Mandi! Guillaume Rousse
>    In chel di` si favelave...
>
>>>   Oct 27 17:59:29 kaa fusinv-agent[3804]: [http server] HTTPD service started at http://localhost:62354
>>> 	(this is wrong, 'netstat' correcly say that is listening to 0.0.0.0:62354 and i can telnet in)
>> It is wrong if you're intepreting it as 'listening on localhost
>> only', indeed. Feel free to suggest a better alternative.
>
> ...boh, i think it depend; if your goal is to provide a valud URL,
> probably http://`hostname -f`:62354 is a better alternative.
That assume than hostname is consistent with DNS name...

> But if the goal is only to provide feedback that internal HTTPD server
> was started, a simpler 'HTTPD service started on port 62354' will
> suffices.
With an additional mention if it is bound to a specific interface, that 
would indeed be more explicit.

>>> then i've defined a task to poll a switch in that network. manual poll works:
> [...]
>>> but still does nothing (eg, task complete OK but no data get imported).
>> That's expected, this tool just output its result on stdout. If you
>> want to upload this result in GLPI, you have to use another tool.
>
> Sorry, i was late and i was really unclear.
> I meant that manual run works, but if i create a task and run it
> (manuial start) task run, complete but provide no data. Sorry.
>
>
>> Just make sure your device is assigned the SNMPv2 credential, not
>> the SNMPv1 one.
>
> A-HA! I'm starting to understand how Fi works... i try to summarize.
>
> 1) we need to add to GLPI a network device (or a printer), add some
>   info like IP addesses (i think needed to have some IP to scan, right?)
> and in 'FI SNMP' tab associate it to the right SNMP auth schema.
> Probably this task can be done automagically with network discovery.
The "automatic" part depend of your import rules, but that's the idea.

> 2) we can check SNMP inventory doing a ''manual'' scan, eg running:
> 	fusioninventory-netinventory --verbose --credentials version:2c,community:public --host m110-1
>   so we can look ad the data the task will get from the device.
Whereas initially meant as a debug tool, fusioninventory-netinventory is 
actually not limited to that. If you're using fusioninventory-injector, 
or even just curl, you can send the results directly to GLPI. And in 
next major version (2.4), there will be an option for that. And avoid 
the need to run fusioninventory-agent completly.

The point is to avoid relying on GLPI task scheduler, and GLPI/agent 
dialog, if you don't need to. See 'autonomous mode' in agent usage 
documentation:
http://www.fusioninventory.org/documentation/agent/usage/

> 3) then we have to create a task (clearly, set to active) in the
>   actions we have to specify the module used (SNMP inventory), specify
> an actor (a host that have FI agent running as a daemon) and one or
> more target.
>
> When the task run (scheduled or manually forced) GLPI contact the
> agent/actor and run the actions specified.
>
>
>> However, your issue here is not SNMPv1 vs SNMPv2, rather than the
>> task you've scheduled on GLPI doesn't seem to run. Just try to force
>> its execution, from GLPI.
>
> No, i've binded the targets to the correct SNMP auth and now:
>
>   Oct 28 09:58:26 kaa fusinv-agent[63961]: running task NetInventory in process 63961
>   Oct 28 09:58:26 kaa fusinv-agent[63961]: FusionInventory NetInventory task 2.2.0
>   Oct 28 09:58:26 kaa fusinv-agent[63961]: [http client] Using Compress::Zlib for compression
>   Oct 28 09:58:26 kaa fusinv-agent[63961]: Thread 1 created in PAUSE state
>   Oct 28 09:58:27 kaa fusinv-agent[63961]: Thread 1 switched to RUN state
>   Oct 28 09:58:27 kaa fusinv-agent[63961]: thread 1: scanning 55
>   Oct 28 09:58:30 kaa fusinv-agent[63961]: thread 1: scanning 198
>   Oct 28 09:58:31 kaa fusinv-agent[63961]: thread 1: scanning 94
>   Oct 28 09:58:44 kaa fusinv-agent[63961]: Thread 1 switched to EXIT state
>
> note that i've defined 4 targets, but effectively one of the target have
> no IP defined. After that, i've redefined the task, using instead of
> one action with 4 target, 4 actions with one target each.
>
>   Oct 28 11:10:54 kaa fusinv-agent[4538]: running task NetInventory in process 4538
>   Oct 28 11:10:54 kaa fusinv-agent[4538]: FusionInventory NetInventory task 2.2.0
>   Oct 28 11:10:54 kaa fusinv-agent[4538]: [http client] Using Compress::Zlib for compression
>   Oct 28 11:10:54 kaa fusinv-agent[4538]: Thread 1 created in PAUSE state
>   Oct 28 11:10:55 kaa fusinv-agent[4538]: Thread 1 switched to RUN state
>   Oct 28 11:10:55 kaa fusinv-agent[4538]: thread 1: scanning 198
>   Oct 28 11:10:56 kaa fusinv-agent[4538]: thread 1: scanning 94
>   Oct 28 11:11:10 kaa fusinv-agent[4538]: thread 1: scanning 55
>   Oct 28 11:11:13 kaa fusinv-agent[4538]: thread 1: scanning 90
>   Oct 28 11:11:15 kaa fusinv-agent[4538]: Thread 1 switched to EXIT state
>
> but nothing changed, no data get imported.
Either the agent is not sending anything to the server (blame the 
agent), either the server is discarding what the agent is sending (blame 
the server). You may try to raise agent debug level to 2, to catch 
messages received and sent to the server, or run a network capture tool 
to identify the culprit.

-- 
Guillaume



More information about the Fusioninventory-user mailing list