Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration file not respecting the full-inventory-postpone parameter #792

Open
erique-souza opened this issue Oct 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@erique-souza
Copy link

Bug reporting acknowledgment

Yes, I read it

Professional support

Still not applicable

Describe the bug

I did some tests using glpi-agent 1.10 and 1.11 using the parameter implemented since 1.8, which is "full-inventory-postpone" which was published in the links below, trying to set its parameter to a smaller interval, for example every 2 inventories , the 3rd would be the full

#669
#592

However, even changing the configuration file as usual, restarting the glpi-agent service, and forcing the inventory a few times, I noticed that the partial inventory continued to be sent, leading me to believe that the parameter itself is not actually being taken. into consideration

I also sent the glpi-agent log in debugg 2 below, and also a partial inventory

image

computer_0_3 (7).json
glpi-agent.txt

I also noticed another situation that is linked to the documentation
In the glpi-agent documentation, it is generally correctly mentioned about "full-inventory-postpone"
https://glpi-agent.readthedocs.io/en/latest/man/glpi-agent.html#inventory-task-specific-options

I also noticed that it is correctly documented also in the parameter commands for windowshttps://glpi-agent.readthedocs.io/en/latest/installation/windows-command-line.html

However for Linux there is no mention of the parameter itself
https://glpi-agent.readthedocs.io/en/latest/installation/linux-appimage.html

Taking advantage of the hook, we have a third situation also linked to the same parameter that I encountered in my tests, the "full-inventory-postpone" was not recognized when installing in Linux using the .pl file as usual, also leading me to believe that it is not implemented for installation via parameter but rather added manually to the post-installation configuration file

I didn't find any mention in the default agent.cfg linux file when it is installed to validate that the parameter I passed was correct
Please correct me if I'm wrong at any point in this post, but these are the considerations I saw when carrying out some more precise tests

To reproduce

  • Install GLPI-Agent 1.8 or higher (Preferably the latest stable version)
  • Add the parameter full-inventory-postpone=2 at the end of the agent.cfg or 00-install.cfg file in /etc/glpi-agent/ and /etc/glpi-agent/conf.d
  • Restart the glpi-agent service using systemctl restart glpi-agent
  • Force some inventories through the glpi-agent command
  • Check the file that the glpi server or proxy received to compare whether it is a full inventory or partial inventory and compare with the expected number of times for the partial inventory

Expected behavior

Partial agent inventory, x number of times instead of the default 14

Operating system

Linux

GLPI Agent version

v1.11

GLPI version

10.0.16

GLPIInventory plugin or other plugin version

Not applicable

Additional context

No response

@erique-souza erique-souza added the bug Something isn't working label Oct 17, 2024
@erique-souza
Copy link
Author

I believe it is the same case for the --full parameter for linux which is also highlighted here: https://glpi-agent.readthedocs.io/en/latest/man/glpi-agent.html#inventory-task-specific-options

{FCA7D163-4B94-4608-93CA-23A2CBD1CB69}

When trying to install glpi-agent passing this --full parameter, the .pl file does not accept it

cd /tmp && apt install wget curl perl -y && wget https:/glpi-project/glpi-agent/releases/download/1.11/glpi-agent-1.11-linux-installer.pl --no-check-certificate && perl glpi-agent-1.11-linux-installer.pl --force --install --full --service --server=https://server.com.br --no-ssl-check --no-category=process --logfile=/var/log/glpi-agent.log --logger=stderr --debug=0 --color=1 --tag=LINUX --httpd-trust=127.0.0.1 --verbose

In the case of what I posted, I tried to use it like this: --full-inventory-postpone=2 in place of --full

@g-bougard
Copy link
Member

Hello @erique-souza

...
[Wed Oct 16 20:12:18 2024][debug] Full inventory postponed: 2/2
...

This log line means the current inventory is the second inventory which have to be postponed so the next inventory, the third will be full.

Maybe you misunderstood the meaning of the option: it's really the number of inventories which have to be postponed before sending a full inventory. So when setting it to 2 means you will have 2 postponed inventories between full inventory.

I will check for linux installers option. But about --full option, this is a foreground glpi-agent shortcut option to be used when you want to force a full inventory from the commandline. This one can't be set in config file and so don't have to be supported by installer. You can't use it as replacement for --full-inventory-postpone=0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants