Skip to content

Commit

Permalink
feat: Update glpi-agent script to support --full-inventory-postpone o…
Browse files Browse the repository at this point in the history
…ption

Also add --full option support to disable full-inventory-postpone
  • Loading branch information
g-bougard committed Jan 31, 2024
1 parent 9ec2834 commit f79c0c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ inventory:
size most of the time. The option can only be used with GLPI 10 and its JSON format.
* Update inventory to be generated in a consistent order as required by new
'full-inventory-postpone' option to detect changes
* Update glpi-agent script with --full-inventory-postpone option support
* Update glpi-agent script with --full option support to force a full inventory

netdiscovery/netinventory:
* Keep device mac address found via snmp during netdiscovery as this is the one
Expand Down
19 changes: 19 additions & 0 deletions bin/glpi-agent
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ GetOptions(
'debug+',
'delaytime=s',
'force|f',
'full',
'full-inventory-postpone=i',
'help|h',
'html',
'json',
Expand Down Expand Up @@ -118,6 +120,11 @@ if ($options->{daemon}) {
}
}

if ($options->{full}) {
# Disable full inventory postpone if requested
$options->{'full-inventory-postpone'} = 0;
}

die "given '$options->{vardir}' vardir folder doesn't exist\n"
if $options->{vardir} && ! -d $options->{vardir};

Expand Down Expand Up @@ -265,6 +272,8 @@ glpi-agent [options] [--server server|--local path]
--partial=CATEGORY make a partial inventory of given category
items, this option implies --json
--credentials set credentials to support database inventory
--full-inventory-postpone=NUM set number of possible full inventory postpone (14)
--full force inventory task to generate a full inventory
RemoteInventory task specific options:
--remote=REMOTE[,REMOTE]... specify a list of remotes to process in place
Expand Down Expand Up @@ -551,6 +560,16 @@ Setup credentials for database inventory
CREDENTIALS should be a list of "key:value" separated by commas like in:
For example: --credentials="type:login_password,login:root,password:********,use:postgresql,params_id:0"
=item B<--full-inventory-postpone>=I<NUM>
Set the number of time the agent can decide to generate a partial inventory with only
changed category before generating a full inventory.
=item B<--full>
Force inventory task to generate a full inventory even if B<full-inventory-postpone> option
is set. Indeed this is equivalent to set B<--full-inventory-postpone=0>.
=item B<--scan-homedirs>
Allow the agent to scan home directories for virtual machines.
Expand Down

0 comments on commit f79c0c4

Please sign in to comment.