You are not logged in.
Pages: 1
Hello all,
I have recently installed GLPI version 10.0.3 and also installed the native GLPI agent on 2 Macs to test.
I have 350+ Macs and 100+ Windows computers to manage.
1. By default, it seems that an inventory is only run "on load". Is this at boot time only?
2. On Macs, how can I have the agent run multiple times a day?
3. I would like to have the agents automatically run an inventory about 3 times a day everyday, but not all at the same time, but within specified time windows. For example, I would like the agents to run the 1st time once between 0900-1000, the 2nd time once between 1500-1600 and the 3rd time once between 2100-2200.
Is this possible?
Thank you
Last edited by netsysadmin (2022-10-09 12:03:06)
Offline
Hi netsysadmin,
by default, the agent runs every 23 to 24h. This is a setup you can change in GLPI.
There's no easy way to setup such accurate scheduling from GLPI: GLPI just tells agent at which frequency an inventory is expected.
But you can achieve your goal using computer scheduling system (crontab on unix, tasks scheduler on windows). With few scripting, you should be able to ask agents to wait for a random time from 0 to 3600 seconds, then force an inventory running such a command as root/sysadmin:
- on windows:
cd c:\Program Files\GLPI-Agent
glpi-agent --force
- on MacOSX:
/Applications/GLPI-Agent/bin/glpi-agent --force
Of course you need to have setup your agent before, otherwise also use "--server http://your-glpi/" option.
The simplest solution will still be to ask for an inventory every 8 hours to have 3 inventories by day, without any guarantee for the hour range.
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
Thank you, gbougard.
I will try that.
Offline
Just an FYI: the agent does not seem to be running every 23-24h on the 2 Macs that installed it.
How can I help you to troubleshoot this?
Offline
You can check/share "/var/log/glpi-agent.log" file.
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
This is the content of /var/log/glpi-agent.log on my MacBook MACBOOK2022:
[Fri Oct 7 20:05:08 2022][error] No target defined, aborting
[Fri Oct 7 20:09:49 2022][info] target server0: server http://glpi-server/glpi/front/inventory.php
[Fri Oct 7 20:09:51 2022][info] sending prolog request to server0
[Fri Oct 7 20:09:51 2022][info] server0 answer shows it supports GLPI Agent protocol
[Fri Oct 7 20:09:52 2022][info] running task Deploy
[Fri Oct 7 20:09:52 2022][error] [http client] communication error: 400 Bad Request, Protocol not supported
[Fri Oct 7 20:09:52 2022][info] Deploy task not supported by server0
[Fri Oct 7 20:09:52 2022][info] running task Collect
[Fri Oct 7 20:09:52 2022][error] [http client] communication error: 400 Bad Request, Protocol not supported
[Fri Oct 7 20:09:52 2022][info] Collect task not supported by server0
[Fri Oct 7 20:09:52 2022][info] running task ESX
[Fri Oct 7 20:09:52 2022][error] [http client] communication error: 400 Bad Request, Protocol not supported
[Fri Oct 7 20:09:52 2022][info] ESX task not supported by server0
[Fri Oct 7 20:09:52 2022][info] running task Inventory
[Fri Oct 7 20:09:52 2022][info] New inventory from MACBOOK2022.local-2022-10-07-20-05-08 for server0
[Sat Oct 8 12:18:14 2022][info] target server0: server http://glpi-server/glpi/front/inventory.php
[Sat Oct 8 12:18:14 2022][info] sending contact request to server0
[Sat Oct 8 12:18:14 2022][info] running task Inventory
[Sat Oct 8 12:18:14 2022][info] New inventory from MACBOOK2022.local-2022-10-07-20-05-08 for server0
[Wed Oct 12 12:19:53 2022][info] GLPI Agent starting
[Wed Oct 12 12:19:55 2022][info] [http server] HTTPD service started on port 62354
[Wed Oct 12 12:19:55 2022][info] target server0: next run: Wed Oct 12 13:00:04 2022 - http://glpi-server/glpi/front/inventory.php
[Wed Oct 12 12:22:05 2022][info] running task Deploy: storage maintenance event
[Wed Oct 12 13:00:04 2022][info] target server0: server http://glpi-server/glpi/front/inventory.php
[Wed Oct 12 13:00:04 2022][info] sending contact request to server0
[Wed Oct 12 13:00:05 2022][info] running task Inventory
[Wed Oct 12 13:00:05 2022][info] New inventory from MACBOOK2022.local-2022-10-07-20-05-08 for server0
[Wed Oct 12 13:58:09 2022][error] can't parse retrieved dates in 'lastModified' field in XML file
[Wed Oct 12 13:58:18 2022][info] target server0: next run: Thu Oct 13 13:07:47 2022 - http://glpi-server/glpi/front/inventory.php
[Thu Oct 13 13:07:47 2022][info] target server0: server http://glpi-server/glpi/front/inventory.php
[Thu Oct 13 13:07:47 2022][info] sending contact request to server0
[Thu Oct 13 13:07:48 2022][info] running task Inventory
[Thu Oct 13 13:07:48 2022][info] New inventory from MACBOOK2022.local-2022-10-07-20-05-08 for server0
[Thu Oct 13 13:20:01 2022][error] can't parse retrieved dates in 'lastModified' field in XML file
[Thu Oct 13 13:20:11 2022][info] target server0: next run: Fri Oct 14 13:07:25 2022 - http://glpi-server/glpi/front/inventory.php
Offline
And below is the content of /Library/LaunchDaemons/org.glpi-project.glpi-agent.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.glpi-project.glpi-agent</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/GLPI-Agent/bin/glpi-agent</string>
<string>--daemon</string>
<string>--no-fork</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>14400</integer>
<key>UserName</key>
<string>root</string>
<key>ProcessType</key>
<string>Background</string>
</dict>
</plist>
Offline
Hi netsysadmin,
can you try the nightly build ? This should still fix the "can't parse retrieved dates in 'lastModified' field in XML file" error.
Get it there: GLPI-Agent nightly builds
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
Pages: 1