You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-11-15 14:09:20

mad_ady
Member
Registered: 2021-11-15
Posts: 5

FusionInventory NetInventory agent doesn't start despite Force Start

Hello all!
I'm new to GLPI/FusionInventory, but I'm slowly getting the hang of it.
I'd like some help/documentation to figure out this problem.

I have a SNMP inventory task that is configured to use a server as an agent (called Heimdall), and that needs to retrieve inventory from a couple of ip ranges. Before this I used the NetDiscovery plugin on the same agent to create asset entries (as computers) for the devices that I want in my inventory. NetDiscovery works, but NetInventory never starts on the agent, and I don't know how to troubleshoot this. A different (but similarly configured NetInventory task on the same agent) starts every time I use Force Start + Force inventory (from Heimdall asset).

When I run Force Start on my NetInventory task, followed by Assets->heimdall -> Force inventory, I get this in the fusioninventory-agent log on the agent:

[Mon Nov 15 13:59:34 2021][debug] forking process 0 to handle task ESX
[Mon Nov 15 13:59:34 2021][debug] ESX task not compatible with local target
[Mon Nov 15 13:59:34 2021][debug] forking process 0 to handle task Inventory
[Mon Nov 15 13:59:34 2021][info] running task Inventory
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::AccessLog
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Arch
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Dmidecode
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Battery
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Bios
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Virtualization
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Virtualization::Vmsystem
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Memory
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Memory
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Ports
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Slots
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Domains
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Environment
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Firewall
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Hostname
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Networks
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::PCI
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::PCI::Controllers
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::PCI::Modems
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::PCI::Sounds
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Printers
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Processes
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Remote_Mgmt
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::SSH
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Screen
[Mon Nov 15 13:59:34 2021][debug] retrieving EDID data:
[Mon Nov 15 13:59:34 2021][debug] - reading /sys/devices content: success
[Mon Nov 15 13:59:34 2021][debug] Parse::EDID Perl module not available, unable to parse EDID data
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Softwares
[Mon Nov 15 13:59:34 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Softwares::RPM
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Storages
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Timezone
[Mon Nov 15 13:59:35 2021][debug] Using strftime to get the timezone name
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::USB
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Generic::Users
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Distro
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Distro::LSB
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Drives
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Inputs
[Mon Nov 15 13:59:35 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::LVM
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Networks
[Mon Nov 15 13:59:36 2021][debug] retrieving interfaces list:
[Mon Nov 15 13:59:36 2021][debug] - running /sbin/ip command: success
[Mon Nov 15 13:59:36 2021][debug] looking for interface speed from syscall:
[Mon Nov 15 13:59:36 2021][debug] - retrieving interface speed from syscall: syscall failed
[Mon Nov 15 13:59:36 2021][debug] looking for interface speed from syscall:
[Mon Nov 15 13:59:36 2021][debug] - retrieving interface speed from syscall: syscall failed
[Mon Nov 15 13:59:36 2021][debug] looking for interface speed from syscall:
[Mon Nov 15 13:59:36 2021][debug] - retrieving interface speed from syscall: syscall failed
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Storages
[Mon Nov 15 13:59:36 2021][debug] retrieving devices list:
[Mon Nov 15 13:59:36 2021][debug] - reading /sys/block content: success
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Storages::Adaptec
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Uptime
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::Videos
[Mon Nov 15 13:59:36 2021][debug] retrieving display information:
[Mon Nov 15 13:59:36 2021][debug] - running ddcprobe command: command not available
[Mon Nov 15 13:59:36 2021][debug] - reading Xorg log file: unable to get Xorg PID
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::i386
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Linux::i386::CPU
[Mon Nov 15 13:59:36 2021][debug] Running FusionInventory::Agent::Task::Inventory::Provider
[Mon Nov 15 13:59:36 2021][debug] last state file '/var/lib/fusioninventory-agent/__LOCAL__/last_state' doesn't exist
[Mon Nov 15 13:59:36 2021][debug] Section INPUT has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section BIOS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section PRINTERS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section VIDEOS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section HARDWARE has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section SOUNDS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section SOFTWARES has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section MEMORIES has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section CONTROLLERS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section STORAGES has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section NETWORKS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section MODEMS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section MONITORS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section DRIVES has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section PORTS has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section REGISTRY has changed since last inventory
[Mon Nov 15 13:59:36 2021][debug] Section SLOTS has changed since last inventory
[Mon Nov 15 13:59:36 2021][info] Inventory saved in /tmp/Heimdall-2020-01-28-10-51-39.ocs
[Mon Nov 15 13:59:36 2021][debug] forking process 0 to handle task Collect
[Mon Nov 15 13:59:36 2021][debug] Collect task not compatible with local target
[Mon Nov 15 13:59:36 2021][debug] forking process 0 to handle task WakeOnLan
[Mon Nov 15 13:59:36 2021][debug] WakeOnLan task not compatible with local target
[Mon Nov 15 13:59:36 2021][debug] forking process 0 to handle task NetDiscovery
[Mon Nov 15 13:59:36 2021][debug] NetDiscovery task not compatible with local target
[Mon Nov 15 13:59:37 2021][debug] forking process 0 to handle task Deploy
[Mon Nov 15 13:59:37 2021][debug] Deploy task not compatible with local target
[Mon Nov 15 13:59:37 2021][debug] forking process 0 to handle task NetInventory
[Mon Nov 15 13:59:37 2021][debug] NetInventory task not compatible with local target

If I run [c]fusioninventory-netinventory  --host 10.0.5.5 --community snmp_secret --credentials version:2,community:snmp_secret --type COMPUTER --control --debug[/c] manually, I can get the expected data, so the inventory itself works. I suspect the problem is on the GLPI side, but I'm not sure where to troubleshoot.

My GLPI version is 9.5.5, my fusioninventory version on my agent is 2.3.21.

Here are my task settings:
- Active : On
- Re-prepare a target-actor if previous run is successful :  On
- Schedule start: 2021-11-02 12:00:00
- Agent wakeup interval (in minutes) : 1
- Number of agents to wake up : 1

Also - note - I don't get anything under Job executions tab. For other jobs I can see status for each element. Here are just the refresh buttons.

Please teach me how to troubleshoot further.
Thanks!

Offline

#2 2021-11-15 16:18:29

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: FusionInventory NetInventory agent doesn't start despite Force Start

Hi mad_ady,

as is saying the line "NetInventory task not compatible with local target", you seems to have configured your agent with only the "local" parameter set. And indeed you have set it to "/tmp" as the inventory is saved there.

So what you need is to set the "server" parameter to something like "http://server/plugins/fusioninventory" depending on how you setup your glpi server.

Actually your agent is not aware by default of any glpi server.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#3 2021-11-16 10:30:24

mad_ady
Member
Registered: 2021-11-15
Posts: 5

Re: FusionInventory NetInventory agent doesn't start despite Force Start

Thank you for your reply.

The agent has a server in its configuration and can communicate with it on port 62354 correctly. I can run both inventory, netdiscovery and netinventory tasks on it, pushed via GLPI. I get the same message (NetInventory not compatible with local target) when I do a force inventory and there are no NetInventory tasks scheduled to run.
Here is proof that a different NetInventory task runs correctly on the agent (grepped log for NetInventory):

[Tue Nov 16 09:06:55 2021][info] running task NetInventory
[Tue Nov 16 09:28:13 2021][debug] forking process 0 to handle task NetInventory
[Tue Nov 16 09:28:13 2021][debug] NetInventory task not compatible with local target
[Tue Nov 16 10:13:56 2021][debug] forking process 0 to handle task NetInventory
[Tue Nov 16 10:13:56 2021][debug] NetInventory task not compatible with local target

I'm guessing I should check on the GLPI side, but I'm not sure where/what to look for.

Offline

#4 2021-11-16 11:13:46

mad_ady
Member
Registered: 2021-11-15
Posts: 5

Re: FusionInventory NetInventory agent doesn't start despite Force Start

Ok, I did more digging on the GLPI side. I tailed these logs:

tail -f pluginFusioninventory-jobs.log pluginFusioninventory-rules.log pluginFusioninventory-tasks.log sql-errors.log cron.log  php-errors.log pluginFusioninventory-jobs.log

and I got these errors while trying to force an inventory to run:

[2021-11-16 10:42:31] glpiphplog.WARNING:   *** PHP Warning (2): error_log(/var/www/html/glpi/files/_log/pluginFusioninventory-jobs.log): failed to open stream: Permission denied in /var/www/html/glpi/inc/toolbox.class.php at line 677
  Backtrace :
  inc/toolbox.class.php:677                          error_log()
  plugins/fusioninventory/inc/toolbox.class.php:70   Toolbox::logInFile()
  plugins/fusioninventory/inc/task.class.php:494     PluginFusioninventoryToolbox::logIfExtradebug()
  plugins/fusioninventory/inc/task.class.php:930     PluginFusioninventoryTask->prepareTaskjobs()
  plugins/fusioninventory/inc/taskview.class.php:445 PluginFusioninventoryTask->forceRunning()
  plugins/fusioninventory/front/task.form.php:52     PluginFusioninventoryTaskView->submitForm()
  
[2021-11-16 10:42:31] glpiphplog.WARNING:   *** PHP Warning (2): error_log(/var/www/html/glpi/files/_log/pluginFusioninventory-communication.log): failed to open stream: Permission denied in /var/www/html/glpi/inc/toolbox.class.php at line 677
  Backtrace :
  inc/toolbox.class.php:677                          error_log()
  plugins/fusioninventory/inc/toolbox.class.php:70   Toolbox::logInFile()
  .../fusioninventory/inc/communication.class.php:75 PluginFusioninventoryToolbox::logIfExtradebug()
  plugins/fusioninventory/inc/task.class.php:593     PluginFusioninventoryCommunication->__construct()
  plugins/fusioninventory/inc/task.class.php:930     PluginFusioninventoryTask->prepareTaskjobs()
  plugins/fusioninventory/inc/taskview.class.php:445 PluginFusioninventoryTask->forceRunning()
  plugins/fusioninventory/front/task.form.php:52     PluginFusioninventoryTaskView->submitForm()

Something must have changed permissions on those log files. I corrected the owners (changed from root -> apache), and reran the Force Inventory, and the task still didn't run. I got these cryptic errors in the GLPI log:

==> cron.log <==
2021-11-16 10:46:02 [@wiki_racktables]
External #1: Launch taskscheduler

==> pluginFusioninventory-jobs.log <==
2021-11-16 10:46:02 [@wiki_racktables]
Preparing tasks jobs, task id: 

==> php-errors.log <==
[2021-11-16 10:46:02] glpiphplog.CRITICAL:   *** Uncaught Exception RuntimeException: Empty IN are not allowed in /var/www/html/glpi/inc/dbmysqliterator.class.php at line 558
  Backtrace :
  inc/dbmysqliterator.class.php:530                  DBmysqlIterator->analyseCriterion()
  inc/dbmysqliterator.class.php:289                  DBmysqlIterator->analyseCrit()
  inc/dbmysqliterator.class.php:94                   DBmysqlIterator->buildQuery()
  inc/dbmysql.class.php:876                          DBmysqlIterator->execute()
  inc/dbutils.class.php:849                          DBmysql->request()
  inc/db.function.php:324                            DbUtils->getAncestorsOf()
  ...ioninventory/inc/networkinventory.class.php:786 getAncestorsOf()
  plugins/fusioninventory/inc/task.class.php:600     PluginFusioninventoryNetworkinventory->getDevicesOfIPRange()
  plugins/fusioninventory/inc/task.class.php:807     PluginFusioninventoryTask->prepareTaskjobs()
  inc/crontask.class.php:943                         PluginFusioninventoryTask::cronTaskscheduler()
  front/cron.php:83                                  CronTask::launch()
  

==> cron.log <==
2021-11-16 10:46:02 [@wiki_racktables]
External #1: Error during taskscheduler execution. Check in "/var/www/html/glpi/files/_log/php-errors.log" for more details.
2021-11-16 10:46:02 [@wiki_racktables]
External #2: Launch wakeupAgents

So - it's trying to start, but because of a possible SQL error it fails. I looked around that line in dbmysqliterator.class.php, but it's just generic checks for a SQL query. I suspect it tries to select already discovered network equipment and add their IPs to the task. Except that my task has 3 IP ranges (one /32 IP each) that are defined as COMPUTERS, not NETWORK, based on the initial NetDiscovery process. And I suspect the task only looks for NETWORK objects, and ignores COMPUTERS, and comes up empty. So I tested this assumption and added an IP range with a switch IP in it. Reran the task and it worked. Except it polled only the switch - it didn't try to poll the COMPUTER devices in the other ranges.

Is this a (known?) limitation in NetInventory, or is it a bug? That it does inventory only for Network devices and not Computers?
My use-case is to use NetInventory to have a limited inventory via SNMP for computers where I can't install fusioninventory-agent (either too old, outside of my management, or appliances), but that have SNMP active.

Thanks

Offline

#5 2021-11-16 11:16:51

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: FusionInventory NetInventory agent doesn't start despite Force Start

Sorry, but this is not a proof NetInventory task runs correctly. This is just a proof NetInventory task is installed on agent side and can be started. I mean it would run correctly if it was doing what you expect ;-)
As I said, the "NetInventory task not compatible with local target" is a proof the agent doesn't know the "server" target at the time it is running. Did you set the server and forget to restart the service ?
Also v2.3.21 is quite an old version and a lot of bug related to network tasks was fixed in the meantime even GLPI-Agent has some fixes related to this tasks compared to FIA 2.6. So anyway you should also think to upgrade the agent. I would even encourage you to try GLPI-Agent as we provides a linux installer to ease its installation and configuration.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#6 2021-11-16 11:43:45

mad_ady
Member
Registered: 2021-11-15
Posts: 5

Re: FusionInventory NetInventory agent doesn't start despite Force Start

Yes, see my other more detailed post. I managed to get the task to work only when I added an IP range with a network device in it. Previously I was trying to do inventory for ranges that had only Computers (not Network devices) and it failed to start. It seems there is a known limitation: github.com/fusioninventory/fusioninventory-for-glpi/issues/1172
I wasn't aware that glpi-agent is a fork of fusioninventory. I'll need to read up on it and maybe give it a try, thanks for the suggestion. Do you know if glpi-agent's NetInventory can create inventory for computer objects? Somehow I doubt it, because there is a limitation in GLPI - which doesn't seem to look in the computer objects when creating a task for netinventory...
I will also update fusioninventory on the agent - I pulled it from an old repo, but I doubt it will fix my problem.

Thanks again!

Offline

Board footer

Powered by FluxBB