Topic: fusioninventory agent daemon and interactive results differ

Hi,

FreeBSD 11.1-RELEASE, Hyper-V, fusioninventory-agent 2.4

Fusioninventory agent in interactive and daemon mode produces different xml (.ocs) files.

E.g.
<VMSYSTEM>Hyper-V</VMSYSTEM> - interactive (from cli)
<VMSYSTEM>Physical</VMSYSTEM> - demon

Also <BIOS>, <CONTROLLERS>, <CPUS> and <MEMORIES> sections are missing for daemon.

Re: fusioninventory agent daemon and interactive results differ

Are you running cli with the same user than daemon ?
A reason could be the path changes between the 2 modes so few important system commands may miss to the daemon.  How do you start the daemon ? From a dedicated script ?

Re: fusioninventory agent daemon and interactive results differ

gbougard wrote:

Are you running cli with the same user than daemon ?
A reason could be the path changes between the 2 modes so few important system commands may miss to the daemon.  How do you start the daemon ? From a dedicated script ?

I am running cli with the same user than startup script included with FreeBSD package distribution which starts agent in daemon mode.

Tried to launch agent in daemon mode from cli just now. All works fine.

There is a problem in startup script. I'm looking for

Re: fusioninventory agent daemon and interactive results differ

Quick solution was add

PATH=$PATH:/usr/local/sbin:/usr/local/bin

to dedicated script.

It's not very good but works.

Maybe something else need to change.

I see some differences in CMD key for PROCESSES. For daemon mode from startup script these keys seems truncated.

5 (edited by angelvg 2018-11-03 06:16:56)

Re: fusioninventory agent daemon and interactive results differ

Hi,

I have the same problem in FreeBSD...

The manual register ok the host hardware in GLPI

But

The daemon task remove the hardware from GLPI (processor, ram, etc.)

Please you can explain the path to insert in what cron?

System cron /etc/crontab have this:

SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
#
#minute hour    mday    month   wday    who     command
#

root cron  by example # crontab -e

In blank

Thank you

6 (edited by angelvg 2018-11-20 15:16:38)

Re: fusioninventory agent daemon and interactive results differ

The complete information about the problem with paths and the solution:

FreeBSDdotCOM/threads/fusioninventory-agent.68113

Basically you need make two adjusts

1) The root crontab

# crontab -e -u root

SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

2) The script

# edit /usr/local/etc/rc.d/fusioninventory

...
load_rc_config $name

PATH="${PATH}:/usr/local/sbin:/usr/local/bin"

: ${fusioninventory_enable:="NO"}
...

I continue in tests, but it seems that with those two adjustments everything works well